diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs index 08446bd68e7..f6e417bca63 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs @@ -69,8 +69,11 @@ internal static class ApiUrlLookup internal static ApiUrls EsqlAsyncQueryDelete = new ApiUrls(new[] { "_query/async/{id}" }); internal static ApiUrls EsqlAsyncQueryGet = new ApiUrls(new[] { "_query/async/{id}" }); internal static ApiUrls EsqlAsyncQueryStop = new ApiUrls(new[] { "_query/async/{id}/stop" }); + internal static ApiUrls EsqlDeleteView = new ApiUrls(new[] { "_query/view/{name}" }); internal static ApiUrls EsqlGetQuery = new ApiUrls(new[] { "_query/queries/{id}" }); + internal static ApiUrls EsqlGetView = new ApiUrls(new[] { "_query/view", "_query/view/{name}" }); internal static ApiUrls EsqlListQueries = new ApiUrls(new[] { "_query/queries" }); + internal static ApiUrls EsqlPutView = new ApiUrls(new[] { "_query/view/{name}" }); 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" }); @@ -100,7 +103,6 @@ internal static class ApiUrlLookup internal static ApiUrls IndexManagementDeleteDataStream = new ApiUrls(new[] { "_data_stream/{name}" }); internal static ApiUrls IndexManagementDeleteDataStreamOptions = new ApiUrls(new[] { "_data_stream/{name}/_options" }); internal static ApiUrls IndexManagementDeleteIndexTemplate = new ApiUrls(new[] { "_index_template/{name}" }); - internal static ApiUrls IndexManagementDeleteSampleConfiguration = new ApiUrls(new[] { "{index}/_sample/config" }); 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}" }); @@ -114,7 +116,6 @@ internal static class ApiUrlLookup internal static ApiUrls IndexManagementForcemerge = new ApiUrls(new[] { "_forcemerge", "{index}/_forcemerge" }); internal static ApiUrls IndexManagementGet = new ApiUrls(new[] { "{index}" }); internal static ApiUrls IndexManagementGetAlias = new ApiUrls(new[] { "_alias", "_alias/{name}", "{index}/_alias/{name}", "{index}/_alias" }); - internal static ApiUrls IndexManagementGetAllSampleConfiguration = new ApiUrls(new[] { "_sample/config" }); internal static ApiUrls IndexManagementGetDataLifecycle = new ApiUrls(new[] { "_data_stream/{name}/_lifecycle" }); internal static ApiUrls IndexManagementGetDataLifecycleStats = new ApiUrls(new[] { "_lifecycle/stats" }); internal static ApiUrls IndexManagementGetDataStream = new ApiUrls(new[] { "_data_stream", "_data_stream/{name}" }); @@ -125,9 +126,6 @@ internal static class ApiUrlLookup 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 IndexManagementGetMigrateReindexStatus = new ApiUrls(new[] { "_migration/reindex/{index}/_status" }); - internal static ApiUrls IndexManagementGetSample = new ApiUrls(new[] { "{index}/_sample" }); - internal static ApiUrls IndexManagementGetSampleConfiguration = new ApiUrls(new[] { "{index}/_sample/config" }); - internal static ApiUrls IndexManagementGetSampleStats = new ApiUrls(new[] { "{index}/_sample/stats" }); 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 IndexManagementMigrateReindex = new ApiUrls(new[] { "_migration/reindex" }); @@ -142,7 +140,6 @@ internal static class ApiUrlLookup internal static ApiUrls IndexManagementPutDataStreamSettings = new ApiUrls(new[] { "_data_stream/{name}/_settings" }); internal static ApiUrls IndexManagementPutIndexTemplate = new ApiUrls(new[] { "_index_template/{name}" }); internal static ApiUrls IndexManagementPutMapping = new ApiUrls(new[] { "{index}/_mapping" }); - internal static ApiUrls IndexManagementPutSampleConfiguration = new ApiUrls(new[] { "{index}/_sample/config" }); 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" }); @@ -164,7 +161,8 @@ internal static class ApiUrlLookup internal static ApiUrls InferenceChatCompletionUnified = new ApiUrls(new[] { "_inference/chat_completion/{inference_id}/_stream" }); internal static ApiUrls InferenceCompletion = new ApiUrls(new[] { "_inference/completion/{inference_id}" }); internal static ApiUrls InferenceDelete = new ApiUrls(new[] { "_inference/{inference_id}", "_inference/{task_type}/{inference_id}" }); - internal static ApiUrls InferenceGet = new ApiUrls(new[] { "_inference", "_inference/{inference_id}", "_inference/{task_type}/{inference_id}" }); + internal static ApiUrls InferenceEmbedding = new ApiUrls(new[] { "_inference/embedding/{inference_id}" }); + internal static ApiUrls InferenceGet = new ApiUrls(new[] { "_inference", "_inference/{inference_id}", "_inference/{task_type}/{inference_id}", "_inference/{task_type}/_all" }); internal static ApiUrls InferenceInference = new ApiUrls(new[] { "_inference/{inference_id}", "_inference/{task_type}/{inference_id}" }); internal static ApiUrls InferencePut = new ApiUrls(new[] { "_inference/{inference_id}", "_inference/{task_type}/{inference_id}" }); internal static ApiUrls InferencePutAi21 = new ApiUrls(new[] { "_inference/{task_type}/{ai21_inference_id}" }); @@ -180,6 +178,7 @@ internal static class ApiUrlLookup internal static ApiUrls InferencePutDeepseek = new ApiUrls(new[] { "_inference/{task_type}/{deepseek_inference_id}" }); internal static ApiUrls InferencePutElasticsearch = new ApiUrls(new[] { "_inference/{task_type}/{elasticsearch_inference_id}" }); internal static ApiUrls InferencePutElser = new ApiUrls(new[] { "_inference/{task_type}/{elser_inference_id}" }); + internal static ApiUrls InferencePutFireworksai = new ApiUrls(new[] { "_inference/{task_type}/{fireworksai_inference_id}" }); internal static ApiUrls InferencePutGoogleaistudio = new ApiUrls(new[] { "_inference/{task_type}/{googleaistudio_inference_id}" }); internal static ApiUrls InferencePutGooglevertexai = new ApiUrls(new[] { "_inference/{task_type}/{googlevertexai_inference_id}" }); internal static ApiUrls InferencePutGroq = new ApiUrls(new[] { "_inference/{task_type}/{groq_inference_id}" }); @@ -338,6 +337,11 @@ 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 ProjectCreateManyRouting = new ApiUrls(new[] { "_project_routing" }); + internal static ApiUrls ProjectCreateRouting = new ApiUrls(new[] { "_project_routing/{name}" }); + internal static ApiUrls ProjectDeleteRouting = new ApiUrls(new[] { "_project_routing/{name}" }); + internal static ApiUrls ProjectGetManyRouting = new ApiUrls(new[] { "_project_routing" }); + internal static ApiUrls ProjectGetRouting = new ApiUrls(new[] { "_project_routing/{name}" }); internal static ApiUrls ProjectTags = new ApiUrls(new[] { "_project/tags" }); internal static ApiUrls QueryRulesDeleteRule = new ApiUrls(new[] { "_query_rules/{ruleset_id}/_rule/{rule_id}" }); internal static ApiUrls QueryRulesDeleteRuleset = new ApiUrls(new[] { "_query_rules/{ruleset_id}" }); @@ -463,8 +467,8 @@ internal static class ApiUrlLookup 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 StreamsLogsDisable = new ApiUrls(new[] { "_streams/logs/_disable" }); - internal static ApiUrls StreamsLogsEnable = new ApiUrls(new[] { "_streams/logs/_enable" }); + internal static ApiUrls StreamsLogsDisable = new ApiUrls(new[] { "_streams/{name}/_disable" }); + internal static ApiUrls StreamsLogsEnable = new ApiUrls(new[] { "_streams/{name}/_enable" }); internal static ApiUrls StreamsStatus = new ApiUrls(new[] { "_streams/status" }); internal static ApiUrls SynonymsDeleteSynonym = new ApiUrls(new[] { "_synonyms/{id}" }); internal static ApiUrls SynonymsDeleteSynonymRule = new ApiUrls(new[] { "_synonyms/{set_id}/{rule_id}" }); 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 03b1c60a7a5..d8f6c165fca 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchRequest.g.cs @@ -36,6 +36,19 @@ public sealed partial class GetAsyncSearchRequestParameters : Elastic.Transport. /// public Elastic.Clients.Elasticsearch.Duration? KeepAlive { get => Q("keep_alive"); set => Q("keep_alive", value); } + /// + /// + /// Specifies whether the response should contain intermediate results if the query is still running when the wait_for_completion_timeout + /// expires or if no wait_for_completion_timeout is specified. + /// If true and the search is still running, the search response + /// will include any hits and partial aggregations that are available. + /// If false and the search is still running, the search response will not include any hits (but possibly include + /// total hits) nor will include any partial aggregations. + /// When not specified, the intermediate results are returned for running queries. + /// + /// + public bool? ReturnIntermediateResults { get => Q("return_intermediate_results"); set => Q("return_intermediate_results", value); } + /// /// /// Specify whether aggregation and suggester names should be prefixed by their respective types in the response @@ -106,6 +119,19 @@ internal GetAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonC /// public Elastic.Clients.Elasticsearch.Duration? KeepAlive { get => Q("keep_alive"); set => Q("keep_alive", value); } + /// + /// + /// Specifies whether the response should contain intermediate results if the query is still running when the wait_for_completion_timeout + /// expires or if no wait_for_completion_timeout is specified. + /// If true and the search is still running, the search response + /// will include any hits and partial aggregations that are available. + /// If false and the search is still running, the search response will not include any hits (but possibly include + /// total hits) nor will include any partial aggregations. + /// When not specified, the intermediate results are returned for running queries. + /// + /// + public bool? ReturnIntermediateResults { get => Q("return_intermediate_results"); set => Q("return_intermediate_results", value); } + /// /// /// Specify whether aggregation and suggester names should be prefixed by their respective types in the response @@ -182,6 +208,23 @@ public Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestDescriptor return this; } + /// + /// + /// Specifies whether the response should contain intermediate results if the query is still running when the wait_for_completion_timeout + /// expires or if no wait_for_completion_timeout is specified. + /// If true and the search is still running, the search response + /// will include any hits and partial aggregations that are available. + /// If false and the search is still running, the search response will not include any hits (but possibly include + /// total hits) nor will include any partial aggregations. + /// When not specified, the intermediate results are returned for running queries. + /// + /// + public Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestDescriptor ReturnIntermediateResults(bool? value = true) + { + Instance.ReturnIntermediateResults = value; + return this; + } + /// /// /// Specify whether aggregation and suggester names should be prefixed by their respective types in the response diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetComponentTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetComponentTemplateRequest.g.cs index 9b0f2d1c5a0..c6f696e7ca5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetComponentTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetComponentTemplateRequest.g.cs @@ -99,8 +99,7 @@ internal GetComponentTemplateRequest(Elastic.Clients.Elasticsearch.Serialization /// /// - /// Comma-separated list of component template names used to limit the request. - /// Wildcard (*) expressions are supported. + /// Name of component template to retrieve. Wildcard (*) expressions are supported. /// /// public Elastic.Clients.Elasticsearch.Name? Name { get => P("name"); set => PO("name", value); } @@ -177,8 +176,7 @@ public GetComponentTemplateRequestDescriptor() /// /// - /// Comma-separated list of component template names used to limit the request. - /// Wildcard (*) expressions are supported. + /// Name of component template to retrieve. Wildcard (*) expressions are supported. /// /// public Elastic.Clients.Elasticsearch.Cluster.GetComponentTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name? value) 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 7de9a5b5900..8b7151e1355 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/HealthRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/HealthRequest.g.cs @@ -27,77 +27,88 @@ public sealed partial class HealthRequestParameters : Elastic.Transport.RequestP { /// /// - /// Whether to expand wildcard expression to concrete indices that are open, closed or both. + /// Expand wildcard expression to concrete indices that are open, closed or both. /// /// public System.Collections.Generic.ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } /// /// - /// Can be one of cluster, indices or shards. Controls the details level of the health information returned. + /// Return health information at a specific level of detail. /// /// public Elastic.Clients.Elasticsearch.Level? Level { get => Q("level"); set => Q("level", value); } /// /// - /// If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node. + /// If true, retrieve information from the local node only. + /// If false, retrieve information 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. + /// The 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. + /// The 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 number controlling to how many active shards to wait for, all to wait for all shards in the cluster to be active, or 0 to not wait. + /// Wait for the specified number of active shards. + /// Use all to wait for all shards in the cluster to be active. + /// Use 0 to not wait. /// /// public Elastic.Clients.Elasticsearch.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } /// /// - /// Can be one of immediate, urgent, high, normal, low, languid. Wait until all currently queued events with the given priority are processed. + /// Wait until all currently queued events with the given priority are processed. /// /// public Elastic.Clients.Elasticsearch.WaitForEvents? WaitForEvents { get => Q("wait_for_events"); set => Q("wait_for_events", value); } /// /// - /// The request waits until the specified number N of nodes is available. It also accepts >=N, <=N, >N and <N. Alternatively, it is possible to use ge(N), le(N), gt(N) and lt(N) notation. + /// Wait until the specified number (N) of nodes is available. + /// It also accepts >=N, <=N, >N and <N. + /// Alternatively, use the notations ge(N), le(N), gt(N), and lt(N). /// /// public Elastic.Clients.Elasticsearch.Cluster.WaitForNodes? 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. + /// Wait (until the timeout expires) for the cluster to have no shard initializations. + /// If false, the request does not wait for initializing shards. /// /// public bool? WaitForNoInitializingShards { get => Q("wait_for_no_initializing_shards"); set => Q("wait_for_no_initializing_shards", value); } /// /// - /// A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations. Defaults to false, which means it will not wait for relocating shards. + /// Wait (until the timeout expires) for the cluster to have no shard relocations. + /// If false, the request not wait for relocating shards. /// /// public bool? WaitForNoRelocatingShards { get => Q("wait_for_no_relocating_shards"); set => Q("wait_for_no_relocating_shards", value); } /// /// - /// One of green, yellow or red. Will wait (until the timeout provided) until the status of the cluster changes to the one provided or better, i.e. green > yellow > red. By default, will not wait for any status. + /// Wait (until the timeout expires) for the cluster to reach a specific health status (or a better status). + /// A green status is better than yellow and yellow is better than red. + /// By default, the request does not wait for a particular status. /// /// public Elastic.Clients.Elasticsearch.HealthStatus? WaitForStatus { get => Q("wait_for_status"); set => Q("wait_for_status", value); } @@ -148,84 +159,97 @@ internal HealthRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstruct /// /// - /// Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard expressions (*) are supported. To target all data streams and indices in a cluster, omit this parameter or use _all or *. + /// A comma-separated list of data streams, indices, and index aliases that limit the request. + /// Wildcard expressions (*) are supported. + /// To target all data streams and indices in a cluster, omit this parameter or use _all or *. /// /// public Elastic.Clients.Elasticsearch.Indices? Indices { get => P("index"); set => PO("index", value); } /// /// - /// Whether to expand wildcard expression to concrete indices that are open, closed or both. + /// Expand wildcard expression to concrete indices that are open, closed or both. /// /// public System.Collections.Generic.ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } /// /// - /// Can be one of cluster, indices or shards. Controls the details level of the health information returned. + /// Return health information at a specific level of detail. /// /// public Elastic.Clients.Elasticsearch.Level? Level { get => Q("level"); set => Q("level", value); } /// /// - /// If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node. + /// If true, retrieve information from the local node only. + /// If false, retrieve information 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. + /// The 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. + /// The 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 number controlling to how many active shards to wait for, all to wait for all shards in the cluster to be active, or 0 to not wait. + /// Wait for the specified number of active shards. + /// Use all to wait for all shards in the cluster to be active. + /// Use 0 to not wait. /// /// public Elastic.Clients.Elasticsearch.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } /// /// - /// Can be one of immediate, urgent, high, normal, low, languid. Wait until all currently queued events with the given priority are processed. + /// Wait until all currently queued events with the given priority are processed. /// /// public Elastic.Clients.Elasticsearch.WaitForEvents? WaitForEvents { get => Q("wait_for_events"); set => Q("wait_for_events", value); } /// /// - /// The request waits until the specified number N of nodes is available. It also accepts >=N, <=N, >N and <N. Alternatively, it is possible to use ge(N), le(N), gt(N) and lt(N) notation. + /// Wait until the specified number (N) of nodes is available. + /// It also accepts >=N, <=N, >N and <N. + /// Alternatively, use the notations ge(N), le(N), gt(N), and lt(N). /// /// public Elastic.Clients.Elasticsearch.Cluster.WaitForNodes? 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. + /// Wait (until the timeout expires) for the cluster to have no shard initializations. + /// If false, the request does not wait for initializing shards. /// /// public bool? WaitForNoInitializingShards { get => Q("wait_for_no_initializing_shards"); set => Q("wait_for_no_initializing_shards", value); } /// /// - /// A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations. Defaults to false, which means it will not wait for relocating shards. + /// Wait (until the timeout expires) for the cluster to have no shard relocations. + /// If false, the request not wait for relocating shards. /// /// public bool? WaitForNoRelocatingShards { get => Q("wait_for_no_relocating_shards"); set => Q("wait_for_no_relocating_shards", value); } /// /// - /// One of green, yellow or red. Will wait (until the timeout provided) until the status of the cluster changes to the one provided or better, i.e. green > yellow > red. By default, will not wait for any status. + /// Wait (until the timeout expires) for the cluster to reach a specific health status (or a better status). + /// A green status is better than yellow and yellow is better than red. + /// By default, the request does not wait for a particular status. /// /// public Elastic.Clients.Elasticsearch.HealthStatus? WaitForStatus { get => Q("wait_for_status"); set => Q("wait_for_status", value); } @@ -274,7 +298,9 @@ public HealthRequestDescriptor() /// /// - /// Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard expressions (*) are supported. To target all data streams and indices in a cluster, omit this parameter or use _all or *. + /// A comma-separated list of data streams, indices, and index aliases that limit the request. + /// Wildcard expressions (*) are supported. + /// To target all data streams and indices in a cluster, omit this parameter or use _all or *. /// /// public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? value) @@ -285,7 +311,7 @@ public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor Indices(Ela /// /// - /// Whether to expand wildcard expression to concrete indices that are open, closed or both. + /// Expand wildcard expression to concrete indices that are open, closed or both. /// /// public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor ExpandWildcards(System.Collections.Generic.ICollection? value) @@ -296,7 +322,7 @@ public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor ExpandWildc /// /// - /// Whether to expand wildcard expression to concrete indices that are open, closed or both. + /// Expand wildcard expression to concrete indices that are open, closed or both. /// /// public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor ExpandWildcards(params Elastic.Clients.Elasticsearch.ExpandWildcard[] values) @@ -307,7 +333,7 @@ public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor ExpandWildc /// /// - /// Can be one of cluster, indices or shards. Controls the details level of the health information returned. + /// Return health information at a specific level of detail. /// /// public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor Level(Elastic.Clients.Elasticsearch.Level? value) @@ -318,7 +344,8 @@ public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor Level(Elast /// /// - /// If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node. + /// If true, retrieve information from the local node only. + /// If false, retrieve information from the master node. /// /// public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor Local(bool? value = true) @@ -329,7 +356,8 @@ public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor Local(bool? /// /// - /// 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. + /// The 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.Cluster.HealthRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? value) @@ -340,7 +368,8 @@ public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor MasterTimeo /// /// - /// Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + /// The 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.Cluster.HealthRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? value) @@ -351,7 +380,9 @@ public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor Timeout(Ela /// /// - /// A number controlling to how many active shards to wait for, all to wait for all shards in the cluster to be active, or 0 to not wait. + /// Wait for the specified number of active shards. + /// Use all to wait for all shards in the cluster to be active. + /// Use 0 to not wait. /// /// public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.WaitForActiveShards? value) @@ -362,7 +393,7 @@ public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor WaitForActi /// /// - /// Can be one of immediate, urgent, high, normal, low, languid. Wait until all currently queued events with the given priority are processed. + /// Wait until all currently queued events with the given priority are processed. /// /// public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor WaitForEvents(Elastic.Clients.Elasticsearch.WaitForEvents? value) @@ -373,7 +404,9 @@ public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor WaitForEven /// /// - /// The request waits until the specified number N of nodes is available. It also accepts >=N, <=N, >N and <N. Alternatively, it is possible to use ge(N), le(N), gt(N) and lt(N) notation. + /// Wait until the specified number (N) of nodes is available. + /// It also accepts >=N, <=N, >N and <N. + /// Alternatively, use the notations ge(N), le(N), gt(N), and lt(N). /// /// public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor WaitForNodes(Elastic.Clients.Elasticsearch.Cluster.WaitForNodes? value) @@ -384,7 +417,8 @@ public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor WaitForNode /// /// - /// 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. + /// Wait (until the timeout expires) for the cluster to have no shard initializations. + /// If false, the request does not wait for initializing shards. /// /// public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor WaitForNoInitializingShards(bool? value = true) @@ -395,7 +429,8 @@ public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor WaitForNoIn /// /// - /// A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations. Defaults to false, which means it will not wait for relocating shards. + /// Wait (until the timeout expires) for the cluster to have no shard relocations. + /// If false, the request not wait for relocating shards. /// /// public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor WaitForNoRelocatingShards(bool? value = true) @@ -406,7 +441,9 @@ public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor WaitForNoRe /// /// - /// One of green, yellow or red. Will wait (until the timeout provided) until the status of the cluster changes to the one provided or better, i.e. green > yellow > red. By default, will not wait for any status. + /// Wait (until the timeout expires) for the cluster to reach a specific health status (or a better status). + /// A green status is better than yellow and yellow is better than red. + /// By default, the request does not wait for a particular status. /// /// public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor WaitForStatus(Elastic.Clients.Elasticsearch.HealthStatus? value) @@ -519,7 +556,9 @@ public HealthRequestDescriptor() /// /// - /// Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard expressions (*) are supported. To target all data streams and indices in a cluster, omit this parameter or use _all or *. + /// A comma-separated list of data streams, indices, and index aliases that limit the request. + /// Wildcard expressions (*) are supported. + /// To target all data streams and indices in a cluster, omit this parameter or use _all or *. /// /// public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? value) @@ -530,7 +569,7 @@ public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor /// /// - /// Whether to expand wildcard expression to concrete indices that are open, closed or both. + /// Expand wildcard expression to concrete indices that are open, closed or both. /// /// public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor ExpandWildcards(System.Collections.Generic.ICollection? value) @@ -541,7 +580,7 @@ public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor /// /// - /// Whether to expand wildcard expression to concrete indices that are open, closed or both. + /// Expand wildcard expression to concrete indices that are open, closed or both. /// /// public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor ExpandWildcards(params Elastic.Clients.Elasticsearch.ExpandWildcard[] values) @@ -552,7 +591,7 @@ public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor /// /// - /// Can be one of cluster, indices or shards. Controls the details level of the health information returned. + /// Return health information at a specific level of detail. /// /// public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor Level(Elastic.Clients.Elasticsearch.Level? value) @@ -563,7 +602,8 @@ public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor /// /// - /// If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node. + /// If true, retrieve information from the local node only. + /// If false, retrieve information from the master node. /// /// public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor Local(bool? value = true) @@ -574,7 +614,8 @@ public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor /// /// - /// 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. + /// The 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.Cluster.HealthRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? value) @@ -585,7 +626,8 @@ public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor /// /// - /// Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + /// The 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.Cluster.HealthRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? value) @@ -596,7 +638,9 @@ public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor /// /// - /// A number controlling to how many active shards to wait for, all to wait for all shards in the cluster to be active, or 0 to not wait. + /// Wait for the specified number of active shards. + /// Use all to wait for all shards in the cluster to be active. + /// Use 0 to not wait. /// /// public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.WaitForActiveShards? value) @@ -607,7 +651,7 @@ public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor /// /// - /// Can be one of immediate, urgent, high, normal, low, languid. Wait until all currently queued events with the given priority are processed. + /// Wait until all currently queued events with the given priority are processed. /// /// public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor WaitForEvents(Elastic.Clients.Elasticsearch.WaitForEvents? value) @@ -618,7 +662,9 @@ public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor /// /// - /// The request waits until the specified number N of nodes is available. It also accepts >=N, <=N, >N and <N. Alternatively, it is possible to use ge(N), le(N), gt(N) and lt(N) notation. + /// Wait until the specified number (N) of nodes is available. + /// It also accepts >=N, <=N, >N and <N. + /// Alternatively, use the notations ge(N), le(N), gt(N), and lt(N). /// /// public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor WaitForNodes(Elastic.Clients.Elasticsearch.Cluster.WaitForNodes? value) @@ -629,7 +675,8 @@ public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor /// /// - /// 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. + /// Wait (until the timeout expires) for the cluster to have no shard initializations. + /// If false, the request does not wait for initializing shards. /// /// public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor WaitForNoInitializingShards(bool? value = true) @@ -640,7 +687,8 @@ public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor /// /// - /// A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations. Defaults to false, which means it will not wait for relocating shards. + /// Wait (until the timeout expires) for the cluster to have no shard relocations. + /// If false, the request not wait for relocating shards. /// /// public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor WaitForNoRelocatingShards(bool? value = true) @@ -651,7 +699,9 @@ public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor /// /// - /// One of green, yellow or red. Will wait (until the timeout provided) until the status of the cluster changes to the one provided or better, i.e. green > yellow > red. By default, will not wait for any status. + /// Wait (until the timeout expires) for the cluster to reach a specific health status (or a better status). + /// A green status is better than yellow and yellow is better than red. + /// By default, the request does not wait for a particular status. /// /// public Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor WaitForStatus(Elastic.Clients.Elasticsearch.HealthStatus? value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryResponse.Converters.g.cs index f02b9b01359..f5a557f1850 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryResponse.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryResponse.Converters.g.cs @@ -32,6 +32,7 @@ public sealed partial class DeleteByQueryResponseConverter : System.Text.Json.Se private static readonly System.Text.Json.JsonEncodedText PropRequestsPerSecond = System.Text.Json.JsonEncodedText.Encode("requests_per_second"u8); private static readonly System.Text.Json.JsonEncodedText PropRetries = System.Text.Json.JsonEncodedText.Encode("retries"u8); private static readonly System.Text.Json.JsonEncodedText PropSliceId = System.Text.Json.JsonEncodedText.Encode("slice_id"u8); + private static readonly System.Text.Json.JsonEncodedText PropSlices = System.Text.Json.JsonEncodedText.Encode("slices"u8); private static readonly System.Text.Json.JsonEncodedText PropTask = System.Text.Json.JsonEncodedText.Encode("task"u8); private static readonly System.Text.Json.JsonEncodedText PropThrottled = System.Text.Json.JsonEncodedText.Encode("throttled"u8); private static readonly System.Text.Json.JsonEncodedText PropThrottledMillis = System.Text.Json.JsonEncodedText.Encode("throttled_millis"u8); @@ -52,6 +53,7 @@ public override Elastic.Clients.Elasticsearch.DeleteByQueryResponse Read(ref Sys LocalJsonValue propRequestsPerSecond = default; LocalJsonValue propRetries = default; LocalJsonValue propSliceId = default; + LocalJsonValue?> propSlices = default; LocalJsonValue propTask = default; LocalJsonValue propThrottled = default; LocalJsonValue propThrottledMillis = default; @@ -98,6 +100,11 @@ public override Elastic.Clients.Elasticsearch.DeleteByQueryResponse Read(ref Sys continue; } + if (propSlices.TryReadProperty(ref reader, options, PropSlices, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + if (propTask.TryReadProperty(ref reader, options, PropTask, null)) { continue; @@ -162,6 +169,7 @@ public override Elastic.Clients.Elasticsearch.DeleteByQueryResponse Read(ref Sys RequestsPerSecond = propRequestsPerSecond.Value, Retries = propRetries.Value, SliceId = propSliceId.Value, + Slices = propSlices.Value, Task = propTask.Value, Throttled = propThrottled.Value, ThrottledMillis = propThrottledMillis.Value, @@ -184,6 +192,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropRequestsPerSecond, value.RequestsPerSecond, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropRetries, value.Retries, null, null); writer.WriteProperty(options, PropSliceId, value.SliceId, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSlices, value.Slices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); writer.WriteProperty(options, PropTask, value.Task, null, null); writer.WriteProperty(options, PropThrottled, value.Throttled, null, null); writer.WriteProperty(options, PropThrottledMillis, value.ThrottledMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryResponse.g.cs index 1858a8d5d78..5771090cafd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryResponse.g.cs @@ -85,6 +85,13 @@ internal DeleteByQueryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonC /// public Elastic.Clients.Elasticsearch.Retries? Retries { get; set; } public int? SliceId { get; set; } + + /// + /// + /// Status of each slice if the delete by query was sliced + /// + /// + public System.Collections.Generic.IReadOnlyCollection? Slices { get; set; } public Elastic.Clients.Elasticsearch.TaskId? Task { get; set; } public Elastic.Clients.Elasticsearch.Duration? Throttled { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.Converters.g.cs index 7d345797a52..4409bb9a245 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.Converters.g.cs @@ -34,7 +34,9 @@ public sealed partial class AsyncQueryRequestConverter : System.Text.Json.Serial private static readonly System.Text.Json.JsonEncodedText PropLocale = System.Text.Json.JsonEncodedText.Encode("locale"u8); private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"u8); private static readonly System.Text.Json.JsonEncodedText PropProfile = System.Text.Json.JsonEncodedText.Encode("profile"u8); + private static readonly System.Text.Json.JsonEncodedText PropProjectRouting = System.Text.Json.JsonEncodedText.Encode("project_routing"u8); private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"u8); + private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"u8); private static readonly System.Text.Json.JsonEncodedText PropWaitForCompletionTimeout = System.Text.Json.JsonEncodedText.Encode("wait_for_completion_timeout"u8); public override Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) @@ -49,7 +51,9 @@ public override Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequest Read(ref Sy LocalJsonValue propLocale = default; LocalJsonValue?> propParams = default; LocalJsonValue propProfile = default; + LocalJsonValue propProjectRouting = default; LocalJsonValue propQuery = default; + LocalJsonValue propTimeZone = default; LocalJsonValue propWaitForCompletionTimeout = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -98,11 +102,21 @@ public override Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequest Read(ref Sy continue; } + if (propProjectRouting.TryReadProperty(ref reader, options, PropProjectRouting, null)) + { + continue; + } + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) { continue; } + if (propTimeZone.TryReadProperty(ref reader, options, PropTimeZone, null)) + { + continue; + } + if (propWaitForCompletionTimeout.TryReadProperty(ref reader, options, PropWaitForCompletionTimeout, null)) { continue; @@ -129,7 +143,9 @@ public override Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequest Read(ref Sy Locale = propLocale.Value, Params = propParams.Value, Profile = propProfile.Value, + ProjectRouting = propProjectRouting.Value, Query = propQuery.Value, + TimeZone = propTimeZone.Value, WaitForCompletionTimeout = propWaitForCompletionTimeout.Value }; } @@ -146,7 +162,9 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropLocale, value.Locale, null, null); writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); writer.WriteProperty(options, PropProfile, value.Profile, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProjectRouting, value.ProjectRouting, null, null); writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); writer.WriteProperty(options, PropWaitForCompletionTimeout, value.WaitForCompletionTimeout, null, null); writer.WriteEndObject(); } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.g.cs index b8b72ae81dc..e514b1c5e8a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.g.cs @@ -196,6 +196,12 @@ internal AsyncQueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// /// public bool? KeepOnCompletion { get; set; } + + /// + /// + /// Returns results (especially dates) formatted per the conventions of the locale. + /// + /// public string? Locale { get; set; } /// @@ -215,6 +221,20 @@ internal AsyncQueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// public bool? Profile { get; set; } + /// + /// + /// Specifies a subset of projects to target using project + /// metadata tags in a subset of Lucene query syntax. + /// Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + /// Examples: + /// _alias:my-project + /// _alias:_origin + /// _alias:pr + /// Supported in serverless only. + /// + /// + public string? ProjectRouting { get; set; } + /// /// /// The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results. @@ -222,6 +242,13 @@ internal AsyncQueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// public required string Query { get; set; } + /// + /// + /// Sets the default timezone of the query. + /// + /// + public string? TimeZone { get; set; } + /// /// /// The period to wait for the request to finish. @@ -416,6 +443,11 @@ public Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequestDescriptor KeepOnComp return this; } + /// + /// + /// Returns results (especially dates) formatted per the conventions of the locale. + /// + /// public Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequestDescriptor Locale(string? value) { Instance.Locale = value; @@ -458,6 +490,24 @@ public Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequestDescriptor Profile(bo return this; } + /// + /// + /// Specifies a subset of projects to target using project + /// metadata tags in a subset of Lucene query syntax. + /// Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + /// Examples: + /// _alias:my-project + /// _alias:_origin + /// _alias:pr + /// Supported in serverless only. + /// + /// + public Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequestDescriptor ProjectRouting(string? value) + { + Instance.ProjectRouting = value; + return this; + } + /// /// /// The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results. @@ -469,6 +519,17 @@ public Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequestDescriptor Query(stri return this; } + /// + /// + /// Sets the default timezone of the query. + /// + /// + public Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequestDescriptor TimeZone(string? value) + { + Instance.TimeZone = value; + return this; + } + /// /// /// The period to wait for the request to finish. @@ -711,6 +772,11 @@ public Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequestDescriptor return this; } + /// + /// + /// Returns results (especially dates) formatted per the conventions of the locale. + /// + /// public Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequestDescriptor Locale(string? value) { Instance.Locale = value; @@ -753,6 +819,24 @@ public Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequestDescriptor return this; } + /// + /// + /// Specifies a subset of projects to target using project + /// metadata tags in a subset of Lucene query syntax. + /// Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + /// Examples: + /// _alias:my-project + /// _alias:_origin + /// _alias:pr + /// Supported in serverless only. + /// + /// + public Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequestDescriptor ProjectRouting(string? value) + { + Instance.ProjectRouting = value; + return this; + } + /// /// /// The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results. @@ -764,6 +848,17 @@ public Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequestDescriptor return this; } + /// + /// + /// Sets the default timezone of the query. + /// + /// + public Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequestDescriptor TimeZone(string? value) + { + Instance.TimeZone = value; + return this; + } + /// /// /// The period to wait for the request to finish. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/DeleteViewRequest.Converters.g.cs similarity index 73% rename from src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleRequest.Converters.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/DeleteViewRequest.Converters.g.cs index 392f24cce90..835becf4913 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleRequest.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/DeleteViewRequest.Converters.g.cs @@ -21,11 +21,11 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; +namespace Elastic.Clients.Elasticsearch.Esql.Json; -public sealed partial class GetSampleRequestConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class DeleteViewRequestConverter : System.Text.Json.Serialization.JsonConverter { - public override Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + public override Elastic.Clients.Elasticsearch.Esql.DeleteViewRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) @@ -40,12 +40,12 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest R } reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + return new Elastic.Clients.Elasticsearch.Esql.DeleteViewRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { }; } - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest value, System.Text.Json.JsonSerializerOptions options) + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.DeleteViewRequest value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/DeleteViewRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/DeleteViewRequest.g.cs new file mode 100644 index 00000000000..392f086505f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/DeleteViewRequest.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Esql; + +public sealed partial class DeleteViewRequestParameters : Elastic.Transport.RequestParameters +{ +} + +/// +/// +/// Delete an ES|QL view. +/// +/// +/// Deletes a stored ES|QL view. +/// +/// +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.Json.DeleteViewRequestConverter))] +public sealed partial class DeleteViewRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public DeleteViewRequest(Elastic.Clients.Elasticsearch.Id name) : base(r => r.Required("name", name)) + { + } + + public DeleteViewRequest() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal DeleteViewRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + internal override Elastic.Clients.Elasticsearch.Requests.ApiUrls ApiUrls => Elastic.Clients.Elasticsearch.Requests.ApiUrlLookup.EsqlDeleteView; + + protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "esql.delete_view"; + + /// + /// + /// The view name to remove. + /// + /// + public required Elastic.Clients.Elasticsearch.Id Name { get => P("name"); set => PR("name", value); } +} + +/// +/// +/// Delete an ES|QL view. +/// +/// +/// Deletes a stored ES|QL view. +/// +/// +public readonly partial struct DeleteViewRequestDescriptor +{ + internal Elastic.Clients.Elasticsearch.Esql.DeleteViewRequest Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public DeleteViewRequestDescriptor(Elastic.Clients.Elasticsearch.Esql.DeleteViewRequest instance) + { + Instance = instance; + } + + public DeleteViewRequestDescriptor(Elastic.Clients.Elasticsearch.Id name) + { + Instance = new Elastic.Clients.Elasticsearch.Esql.DeleteViewRequest(name); + } + + [System.Obsolete("The use of the parameterless constructor is not permitted for this type.")] + public DeleteViewRequestDescriptor() + { + throw new System.InvalidOperationException("The use of the parameterless constructor is not permitted for this type."); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Esql.DeleteViewRequestDescriptor(Elastic.Clients.Elasticsearch.Esql.DeleteViewRequest instance) => new Elastic.Clients.Elasticsearch.Esql.DeleteViewRequestDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Esql.DeleteViewRequest(Elastic.Clients.Elasticsearch.Esql.DeleteViewRequestDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// The view name to remove. + /// + /// + public Elastic.Clients.Elasticsearch.Esql.DeleteViewRequestDescriptor Name(Elastic.Clients.Elasticsearch.Id value) + { + Instance.Name = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Esql.DeleteViewRequest Build(System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Esql.DeleteViewRequestDescriptor(new Elastic.Clients.Elasticsearch.Esql.DeleteViewRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } + + public Elastic.Clients.Elasticsearch.Esql.DeleteViewRequestDescriptor ErrorTrace(bool? value) + { + Instance.ErrorTrace = value; + return this; + } + + [System.Diagnostics.CodeAnalysis.Experimental("ESEXP0001", UrlFormat = "https://www.elastic.co/docs/reference/elasticsearch/clients/dotnet/experimental#{0}" +#if NET10_0_OR_GREATER + , Message = "Use of response filtering can result in a response from Elasticsearch that cannot be correctly deserialized to the respective response type for the request." +#endif + )] + public Elastic.Clients.Elasticsearch.Esql.DeleteViewRequestDescriptor FilterPath(params string[]? value) + { + Instance.FilterPath = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Esql.DeleteViewRequestDescriptor Human(bool? value) + { + Instance.Human = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Esql.DeleteViewRequestDescriptor Pretty(bool? value) + { + Instance.Pretty = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Esql.DeleteViewRequestDescriptor SourceQueryString(string? value) + { + Instance.SourceQueryString = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Esql.DeleteViewRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) + { + Instance.RequestConfiguration = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Esql.DeleteViewRequestDescriptor RequestConfiguration(System.Func? configurationSelector) + { + Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; + return this; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutSampleConfigurationResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/DeleteViewResponse.Converters.g.cs similarity index 75% rename from src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutSampleConfigurationResponse.Converters.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/DeleteViewResponse.Converters.g.cs index 90a52136335..0be7886214a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutSampleConfigurationResponse.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/DeleteViewResponse.Converters.g.cs @@ -21,13 +21,13 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; +namespace Elastic.Clients.Elasticsearch.Esql.Json; -public sealed partial class PutSampleConfigurationResponseConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class DeleteViewResponseConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"u8); - public override Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + public override Elastic.Clients.Elasticsearch.Esql.DeleteViewResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propAcknowledged = default; @@ -48,13 +48,13 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigura } reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + return new Elastic.Clients.Elasticsearch.Esql.DeleteViewResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Acknowledged = propAcknowledged.Value }; } - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationResponse value, System.Text.Json.JsonSerializerOptions options) + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.DeleteViewResponse value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutSampleConfigurationResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/DeleteViewResponse.g.cs similarity index 79% rename from src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutSampleConfigurationResponse.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/DeleteViewResponse.g.cs index b6d858b9121..a8d360982e0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutSampleConfigurationResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/DeleteViewResponse.g.cs @@ -21,18 +21,18 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.IndexManagement; +namespace Elastic.Clients.Elasticsearch.Esql; -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.PutSampleConfigurationResponseConverter))] -public sealed partial class PutSampleConfigurationResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.Json.DeleteViewResponseConverter))] +public sealed partial class DeleteViewResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public PutSampleConfigurationResponse() + public DeleteViewResponse() { } [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - internal PutSampleConfigurationResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + internal DeleteViewResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) { _ = sentinel; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryRequest.Converters.g.cs index ecb6c1b51a0..deae9f1e95e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryRequest.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryRequest.Converters.g.cs @@ -32,7 +32,9 @@ public sealed partial class EsqlQueryRequestConverter : System.Text.Json.Seriali private static readonly System.Text.Json.JsonEncodedText PropLocale = System.Text.Json.JsonEncodedText.Encode("locale"u8); private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"u8); private static readonly System.Text.Json.JsonEncodedText PropProfile = System.Text.Json.JsonEncodedText.Encode("profile"u8); + private static readonly System.Text.Json.JsonEncodedText PropProjectRouting = System.Text.Json.JsonEncodedText.Encode("project_routing"u8); private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"u8); + private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"u8); public override Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { @@ -42,9 +44,11 @@ public override Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequest Read(ref Sys LocalJsonValue propIncludeCcsMetadata = default; LocalJsonValue propIncludeExecutionMetadata = default; LocalJsonValue propLocale = default; - LocalJsonValue>?> propParams = default; + LocalJsonValue>, System.Collections.Generic.ICollection>>>?> propParams = default; LocalJsonValue propProfile = default; + LocalJsonValue propProjectRouting = default; LocalJsonValue propQuery = default; + LocalJsonValue propTimeZone = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propColumnar.TryReadProperty(ref reader, options, PropColumnar, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) @@ -72,7 +76,7 @@ public override Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequest Read(ref Sys continue; } - if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!))) + if (propParams.TryReadProperty(ref reader, options, PropParams, static Elastic.Clients.Elasticsearch.Union>, System.Collections.Generic.ICollection>>>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>, System.Collections.Generic.ICollection>>>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.T1(ref r, o), static System.Collections.Generic.ICollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)!, static System.Collections.Generic.ICollection>> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>>(o, static System.Collections.Generic.KeyValuePair> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!))!))) { continue; } @@ -82,11 +86,21 @@ public override Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequest Read(ref Sys continue; } + if (propProjectRouting.TryReadProperty(ref reader, options, PropProjectRouting, null)) + { + continue; + } + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) { continue; } + if (propTimeZone.TryReadProperty(ref reader, options, PropTimeZone, null)) + { + continue; + } + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) { reader.SafeSkip(); @@ -106,7 +120,9 @@ public override Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequest Read(ref Sys Locale = propLocale.Value, Params = propParams.Value, Profile = propProfile.Value, - Query = propQuery.Value + ProjectRouting = propProjectRouting.Value, + Query = propQuery.Value, + TimeZone = propTimeZone.Value }; } @@ -118,9 +134,11 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropIncludeCcsMetadata, value.IncludeCcsMetadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropIncludeExecutionMetadata, value.IncludeExecutionMetadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropLocale, value.Locale, null, null); - writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); + writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>, System.Collections.Generic.ICollection>>>? v) => w.WriteUnionValue>, System.Collections.Generic.ICollection>>>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection> v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>> v) => w.WriteCollectionValue>>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair> v) => w.WriteKeyValuePairValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))))); writer.WriteProperty(options, PropProfile, value.Profile, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProjectRouting, value.ProjectRouting, null, null); writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); writer.WriteEndObject(); } } \ No newline at end of file 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 40aefe85622..1db4abcd5d4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryRequest.g.cs @@ -165,6 +165,12 @@ internal EsqlQueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstr /// /// public bool? IncludeExecutionMetadata { get; set; } + + /// + /// + /// Returns results (especially dates) formatted per the conventions of the locale. + /// + /// public string? Locale { get; set; } /// @@ -172,7 +178,7 @@ internal EsqlQueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstr /// 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 System.Collections.Generic.ICollection>? Params { get; set; } + public Elastic.Clients.Elasticsearch.Union>, System.Collections.Generic.ICollection>>>? Params { get; set; } /// /// @@ -184,12 +190,33 @@ internal EsqlQueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstr /// public bool? Profile { get; set; } + /// + /// + /// Specifies a subset of projects to target using project + /// metadata tags in a subset of Lucene query syntax. + /// Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + /// Examples: + /// _alias:my-project + /// _alias:_origin + /// _alias:pr + /// Supported in serverless only. + /// + /// + public string? ProjectRouting { get; set; } + /// /// /// The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results. /// /// public required string Query { get; set; } + + /// + /// + /// Sets the default timezone of the query. + /// + /// + public string? TimeZone { get; set; } } /// @@ -341,6 +368,11 @@ public Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequestDescriptor IncludeExec return this; } + /// + /// + /// Returns results (especially dates) formatted per the conventions of the locale. + /// + /// public Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequestDescriptor Locale(string? value) { Instance.Locale = value; @@ -352,7 +384,7 @@ public Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequestDescriptor Locale(stri /// 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 Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequestDescriptor Params(System.Collections.Generic.ICollection>? value) + public Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequestDescriptor Params(Elastic.Clients.Elasticsearch.Union>, System.Collections.Generic.ICollection>>>? value) { Instance.Params = value; return this; @@ -360,26 +392,33 @@ public Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequestDescriptor Params(Syst /// /// - /// 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. + /// If provided and true the response will include an extra profile object + /// with information on how the query was executed. This information is for human debugging + /// and its format can change at any time but it can give some insight into the performance + /// of each part of the query. /// /// - public Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequestDescriptor Params(params System.Collections.Generic.ICollection[] values) + public Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequestDescriptor Profile(bool? value = true) { - Instance.Params = [.. values]; + Instance.Profile = value; return this; } /// /// - /// If provided and true the response will include an extra profile object - /// with information on how the query was executed. This information is for human debugging - /// and its format can change at any time but it can give some insight into the performance - /// of each part of the query. + /// Specifies a subset of projects to target using project + /// metadata tags in a subset of Lucene query syntax. + /// Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + /// Examples: + /// _alias:my-project + /// _alias:_origin + /// _alias:pr + /// Supported in serverless only. /// /// - public Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequestDescriptor Profile(bool? value = true) + public Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequestDescriptor ProjectRouting(string? value) { - Instance.Profile = value; + Instance.ProjectRouting = value; return this; } @@ -394,6 +433,17 @@ public Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequestDescriptor Query(strin return this; } + /// + /// + /// Sets the default timezone of the query. + /// + /// + public Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequestDescriptor TimeZone(string? value) + { + Instance.TimeZone = value; + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequest Build(System.Action action) { @@ -588,6 +638,11 @@ public Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequestDescriptor return this; } + /// + /// + /// Returns results (especially dates) formatted per the conventions of the locale. + /// + /// public Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequestDescriptor Locale(string? value) { Instance.Locale = value; @@ -599,7 +654,7 @@ public Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequestDescriptor /// 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 Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequestDescriptor Params(System.Collections.Generic.ICollection>? value) + public Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequestDescriptor Params(Elastic.Clients.Elasticsearch.Union>, System.Collections.Generic.ICollection>>>? value) { Instance.Params = value; return this; @@ -607,26 +662,33 @@ public Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequestDescriptor /// /// - /// 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. + /// If provided and true the response will include an extra profile object + /// with information on how the query was executed. This information is for human debugging + /// and its format can change at any time but it can give some insight into the performance + /// of each part of the query. /// /// - public Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequestDescriptor Params(params System.Collections.Generic.ICollection[] values) + public Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequestDescriptor Profile(bool? value = true) { - Instance.Params = [.. values]; + Instance.Profile = value; return this; } /// /// - /// If provided and true the response will include an extra profile object - /// with information on how the query was executed. This information is for human debugging - /// and its format can change at any time but it can give some insight into the performance - /// of each part of the query. + /// Specifies a subset of projects to target using project + /// metadata tags in a subset of Lucene query syntax. + /// Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + /// Examples: + /// _alias:my-project + /// _alias:_origin + /// _alias:pr + /// Supported in serverless only. /// /// - public Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequestDescriptor Profile(bool? value = true) + public Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequestDescriptor ProjectRouting(string? value) { - Instance.Profile = value; + Instance.ProjectRouting = value; return this; } @@ -641,6 +703,17 @@ public Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequestDescriptor return this; } + /// + /// + /// Sets the default timezone of the query. + /// + /// + public Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequestDescriptor TimeZone(string? value) + { + Instance.TimeZone = value; + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequest Build(System.Action> action) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleConfigurationRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/GetViewRequest.Converters.g.cs similarity index 71% rename from src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleConfigurationRequest.Converters.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/GetViewRequest.Converters.g.cs index 5fb5531c3f1..fdf46f351be 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleConfigurationRequest.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/GetViewRequest.Converters.g.cs @@ -21,11 +21,11 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; +namespace Elastic.Clients.Elasticsearch.Esql.Json; -public sealed partial class GetSampleConfigurationRequestConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class GetViewRequestConverter : System.Text.Json.Serialization.JsonConverter { - public override Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + public override Elastic.Clients.Elasticsearch.Esql.GetViewRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) @@ -40,12 +40,12 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigura } reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + return new Elastic.Clients.Elasticsearch.Esql.GetViewRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { }; } - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequest value, System.Text.Json.JsonSerializerOptions options) + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.GetViewRequest value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/GetViewRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/GetViewRequest.g.cs new file mode 100644 index 00000000000..1b5082c8da8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/GetViewRequest.g.cs @@ -0,0 +1,172 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the 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.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Esql; + +public sealed partial class GetViewRequestParameters : Elastic.Transport.RequestParameters +{ +} + +/// +/// +/// Get an ES|QL view. +/// +/// +/// Returns a stored ES|QL view. +/// +/// +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.Json.GetViewRequestConverter))] +public sealed partial class GetViewRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest +{ + public GetViewRequest(Elastic.Clients.Elasticsearch.Id? name) : base(r => r.Optional("name", name)) + { + } + + public GetViewRequest() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal GetViewRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + internal override Elastic.Clients.Elasticsearch.Requests.ApiUrls ApiUrls => Elastic.Clients.Elasticsearch.Requests.ApiUrlLookup.EsqlGetView; + + protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "esql.get_view"; + + /// + /// + /// The comma-separated view names to retrieve. + /// + /// + public Elastic.Clients.Elasticsearch.Id? Name { get => P("name"); set => PO("name", value); } +} + +/// +/// +/// Get an ES|QL view. +/// +/// +/// Returns a stored ES|QL view. +/// +/// +public readonly partial struct GetViewRequestDescriptor +{ + internal Elastic.Clients.Elasticsearch.Esql.GetViewRequest Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public GetViewRequestDescriptor(Elastic.Clients.Elasticsearch.Esql.GetViewRequest instance) + { + Instance = instance; + } + + public GetViewRequestDescriptor(Elastic.Clients.Elasticsearch.Id? name) + { + Instance = new Elastic.Clients.Elasticsearch.Esql.GetViewRequest(name); + } + + public GetViewRequestDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Esql.GetViewRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Esql.GetViewRequestDescriptor(Elastic.Clients.Elasticsearch.Esql.GetViewRequest instance) => new Elastic.Clients.Elasticsearch.Esql.GetViewRequestDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Esql.GetViewRequest(Elastic.Clients.Elasticsearch.Esql.GetViewRequestDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// The comma-separated view names to retrieve. + /// + /// + public Elastic.Clients.Elasticsearch.Esql.GetViewRequestDescriptor Name(Elastic.Clients.Elasticsearch.Id? value) + { + Instance.Name = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Esql.GetViewRequest Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Esql.GetViewRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Esql.GetViewRequestDescriptor(new Elastic.Clients.Elasticsearch.Esql.GetViewRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } + + public Elastic.Clients.Elasticsearch.Esql.GetViewRequestDescriptor ErrorTrace(bool? value) + { + Instance.ErrorTrace = value; + return this; + } + + [System.Diagnostics.CodeAnalysis.Experimental("ESEXP0001", UrlFormat = "https://www.elastic.co/docs/reference/elasticsearch/clients/dotnet/experimental#{0}" +#if NET10_0_OR_GREATER + , Message = "Use of response filtering can result in a response from Elasticsearch that cannot be correctly deserialized to the respective response type for the request." +#endif + )] + public Elastic.Clients.Elasticsearch.Esql.GetViewRequestDescriptor FilterPath(params string[]? value) + { + Instance.FilterPath = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Esql.GetViewRequestDescriptor Human(bool? value) + { + Instance.Human = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Esql.GetViewRequestDescriptor Pretty(bool? value) + { + Instance.Pretty = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Esql.GetViewRequestDescriptor SourceQueryString(string? value) + { + Instance.SourceQueryString = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Esql.GetViewRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) + { + Instance.RequestConfiguration = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Esql.GetViewRequestDescriptor RequestConfiguration(System.Func? configurationSelector) + { + Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; + return this; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/GetViewResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/GetViewResponse.Converters.g.cs new file mode 100644 index 00000000000..78e9b58291c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/GetViewResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Esql.Json; + +public sealed partial class GetViewResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropViews = System.Text.Json.JsonEncodedText.Encode("views"u8); + + public override Elastic.Clients.Elasticsearch.Esql.GetViewResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propViews = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propViews.TryReadProperty(ref reader, options, PropViews, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Esql.GetViewResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Views = propViews.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.GetViewResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropViews, value.Views, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAllSampleConfigurationResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/GetViewResponse.g.cs similarity index 73% rename from src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAllSampleConfigurationResponse.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/GetViewResponse.g.cs index 1994730581b..b457d96be51 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAllSampleConfigurationResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/GetViewResponse.g.cs @@ -21,21 +21,21 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.IndexManagement; +namespace Elastic.Clients.Elasticsearch.Esql; -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetAllSampleConfigurationResponseConverter))] -public sealed partial class GetAllSampleConfigurationResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.Json.GetViewResponseConverter))] +public sealed partial class GetViewResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public GetAllSampleConfigurationResponse() + public GetViewResponse() { } [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - internal GetAllSampleConfigurationResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + internal GetViewResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) { _ = sentinel; } - public required System.Collections.Generic.IReadOnlyCollection Configurations { get; set; } + public required System.Collections.Generic.IReadOnlyCollection Views { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/PutViewRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/PutViewRequest.Converters.g.cs new file mode 100644 index 00000000000..f846bae3402 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/PutViewRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Esql.Json; + +public sealed partial class PutViewRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"u8); + + public override Elastic.Clients.Elasticsearch.Esql.PutViewRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propQuery = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Esql.PutViewRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Query = propQuery.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.PutViewRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/PutViewRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/PutViewRequest.g.cs new file mode 100644 index 00000000000..81fcf3c278d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/PutViewRequest.g.cs @@ -0,0 +1,190 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the 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.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Esql; + +public sealed partial class PutViewRequestParameters : Elastic.Transport.RequestParameters +{ +} + +/// +/// +/// Create or update an ES|QL view. +/// +/// +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.Json.PutViewRequestConverter))] +public sealed partial class PutViewRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest +{ + [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public PutViewRequest(Elastic.Clients.Elasticsearch.Id name) : base(r => r.Required("name", name)) + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public PutViewRequest(Elastic.Clients.Elasticsearch.Id name, string query) : base(r => r.Required("name", name)) + { + Query = query; + } + + public PutViewRequest() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal PutViewRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + internal override Elastic.Clients.Elasticsearch.Requests.ApiUrls ApiUrls => Elastic.Clients.Elasticsearch.Requests.ApiUrlLookup.EsqlPutView; + + protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "esql.put_view"; + + /// + /// + /// The view name to create or update. + /// + /// + public required Elastic.Clients.Elasticsearch.Id Name { get => P("name"); set => PR("name", value); } + + /// + /// + /// The ES|QL query string from which to create a view. + /// + /// + public required string Query { get; set; } +} + +/// +/// +/// Create or update an ES|QL view. +/// +/// +public readonly partial struct PutViewRequestDescriptor +{ + internal Elastic.Clients.Elasticsearch.Esql.PutViewRequest Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public PutViewRequestDescriptor(Elastic.Clients.Elasticsearch.Esql.PutViewRequest instance) + { + Instance = instance; + } + + public PutViewRequestDescriptor(Elastic.Clients.Elasticsearch.Id name) + { +#pragma warning disable CS0618 + Instance = new Elastic.Clients.Elasticsearch.Esql.PutViewRequest(name); +#pragma warning restore CS0618 + } + + [System.Obsolete("The use of the parameterless constructor is not permitted for this type.")] + public PutViewRequestDescriptor() + { + throw new System.InvalidOperationException("The use of the parameterless constructor is not permitted for this type."); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Esql.PutViewRequestDescriptor(Elastic.Clients.Elasticsearch.Esql.PutViewRequest instance) => new Elastic.Clients.Elasticsearch.Esql.PutViewRequestDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Esql.PutViewRequest(Elastic.Clients.Elasticsearch.Esql.PutViewRequestDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// The view name to create or update. + /// + /// + public Elastic.Clients.Elasticsearch.Esql.PutViewRequestDescriptor Name(Elastic.Clients.Elasticsearch.Id value) + { + Instance.Name = value; + return this; + } + + /// + /// + /// The ES|QL query string from which to create a view. + /// + /// + public Elastic.Clients.Elasticsearch.Esql.PutViewRequestDescriptor Query(string value) + { + Instance.Query = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Esql.PutViewRequest Build(System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Esql.PutViewRequestDescriptor(new Elastic.Clients.Elasticsearch.Esql.PutViewRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } + + public Elastic.Clients.Elasticsearch.Esql.PutViewRequestDescriptor ErrorTrace(bool? value) + { + Instance.ErrorTrace = value; + return this; + } + + [System.Diagnostics.CodeAnalysis.Experimental("ESEXP0001", UrlFormat = "https://www.elastic.co/docs/reference/elasticsearch/clients/dotnet/experimental#{0}" +#if NET10_0_OR_GREATER + , Message = "Use of response filtering can result in a response from Elasticsearch that cannot be correctly deserialized to the respective response type for the request." +#endif + )] + public Elastic.Clients.Elasticsearch.Esql.PutViewRequestDescriptor FilterPath(params string[]? value) + { + Instance.FilterPath = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Esql.PutViewRequestDescriptor Human(bool? value) + { + Instance.Human = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Esql.PutViewRequestDescriptor Pretty(bool? value) + { + Instance.Pretty = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Esql.PutViewRequestDescriptor SourceQueryString(string? value) + { + Instance.SourceQueryString = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Esql.PutViewRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) + { + Instance.RequestConfiguration = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Esql.PutViewRequestDescriptor RequestConfiguration(System.Func? configurationSelector) + { + Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; + return this; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteSampleConfigurationResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/PutViewResponse.Converters.g.cs similarity index 74% rename from src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteSampleConfigurationResponse.Converters.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/PutViewResponse.Converters.g.cs index 44c8f237f28..652cf1bd2f8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteSampleConfigurationResponse.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/PutViewResponse.Converters.g.cs @@ -21,13 +21,13 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; +namespace Elastic.Clients.Elasticsearch.Esql.Json; -public sealed partial class DeleteSampleConfigurationResponseConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class PutViewResponseConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"u8); - public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + public override Elastic.Clients.Elasticsearch.Esql.PutViewResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propAcknowledged = default; @@ -48,13 +48,13 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfig } reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + return new Elastic.Clients.Elasticsearch.Esql.PutViewResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Acknowledged = propAcknowledged.Value }; } - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationResponse value, System.Text.Json.JsonSerializerOptions options) + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.PutViewResponse value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteSampleConfigurationResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/PutViewResponse.g.cs similarity index 79% rename from src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteSampleConfigurationResponse.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/PutViewResponse.g.cs index 82041f93724..d598da468c8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteSampleConfigurationResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/PutViewResponse.g.cs @@ -21,18 +21,18 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.IndexManagement; +namespace Elastic.Clients.Elasticsearch.Esql; -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DeleteSampleConfigurationResponseConverter))] -public sealed partial class DeleteSampleConfigurationResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.Json.PutViewResponseConverter))] +public sealed partial class PutViewResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public DeleteSampleConfigurationResponse() + public PutViewResponse() { } [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - internal DeleteSampleConfigurationResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + internal PutViewResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) { _ = sentinel; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteSampleConfigurationRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteSampleConfigurationRequest.Converters.g.cs deleted file mode 100644 index 65ed74e7dd3..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteSampleConfigurationRequest.Converters.g.cs +++ /dev/null @@ -1,53 +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.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; - -public sealed partial class DeleteSampleConfigurationRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.SafeSkip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteSampleConfigurationRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteSampleConfigurationRequest.g.cs deleted file mode 100644 index 9bedc9f6a9a..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteSampleConfigurationRequest.g.cs +++ /dev/null @@ -1,350 +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.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.IndexManagement; - -public sealed partial class DeleteSampleConfigurationRequestParameters : Elastic.Transport.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); } -} - -/// -/// -/// Delete sampling configuration. -/// -/// -/// Delete the sampling configuration for the specified index. -/// -/// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DeleteSampleConfigurationRequestConverter))] -public sealed partial class DeleteSampleConfigurationRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest -{ - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public DeleteSampleConfigurationRequest(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) - { - } - - public DeleteSampleConfigurationRequest() - { - } - - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - internal DeleteSampleConfigurationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) - { - _ = sentinel; - } - - internal override Elastic.Clients.Elasticsearch.Requests.ApiUrls ApiUrls => Elastic.Clients.Elasticsearch.Requests.ApiUrlLookup.IndexManagementDeleteSampleConfiguration; - - protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.DELETE; - - internal override bool SupportsBody => false; - - internal override string OperationName => "indices.delete_sample_configuration"; - - /// - /// - /// The name of the index. - /// - /// - public required Elastic.Clients.Elasticsearch.IndexName Index { get => P("index"); set => PR("index", 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); } -} - -/// -/// -/// Delete sampling configuration. -/// -/// -/// Delete the sampling configuration for the specified index. -/// -/// -public readonly partial struct DeleteSampleConfigurationRequestDescriptor -{ - internal Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequest Instance { get; init; } - - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public DeleteSampleConfigurationRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequest instance) - { - Instance = instance; - } - - public DeleteSampleConfigurationRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) - { - Instance = new Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequest(index); - } - - [System.Obsolete("The use of the parameterless constructor is not permitted for this type.")] - public DeleteSampleConfigurationRequestDescriptor() - { - throw new System.InvalidOperationException("The use of the parameterless constructor is not permitted for this type."); - } - - public static explicit operator Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequest instance) => new Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor(instance); - public static implicit operator Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequest(Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor descriptor) => descriptor.Instance; - - /// - /// - /// The name of the index. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName value) - { - Instance.Index = value; - return this; - } - - /// - /// - /// Period to wait for a connection to the master node. If no response is - /// received before the timeout expires, the request fails and returns an - /// error. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? value) - { - Instance.MasterTimeout = value; - return this; - } - - /// - /// - /// Period to wait for a response. - /// If no response is received before the timeout expires, the request fails and returns an error. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? value) - { - Instance.Timeout = value; - return this; - } - - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - internal static Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequest Build(System.Action action) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor(new Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); - action.Invoke(builder); - return builder.Instance; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor ErrorTrace(bool? value) - { - Instance.ErrorTrace = value; - return this; - } - - [System.Diagnostics.CodeAnalysis.Experimental("ESEXP0001", UrlFormat = "https://www.elastic.co/docs/reference/elasticsearch/clients/dotnet/experimental#{0}" -#if NET10_0_OR_GREATER - , Message = "Use of response filtering can result in a response from Elasticsearch that cannot be correctly deserialized to the respective response type for the request." -#endif - )] - public Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor FilterPath(params string[]? value) - { - Instance.FilterPath = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor Human(bool? value) - { - Instance.Human = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor Pretty(bool? value) - { - Instance.Pretty = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor SourceQueryString(string? value) - { - Instance.SourceQueryString = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) - { - Instance.RequestConfiguration = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor RequestConfiguration(System.Func? configurationSelector) - { - Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; - return this; - } -} - -/// -/// -/// Delete sampling configuration. -/// -/// -/// Delete the sampling configuration for the specified index. -/// -/// -public readonly partial struct DeleteSampleConfigurationRequestDescriptor -{ - internal Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequest Instance { get; init; } - - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public DeleteSampleConfigurationRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequest instance) - { - Instance = instance; - } - - public DeleteSampleConfigurationRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) - { - Instance = new Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequest(index); - } - - public DeleteSampleConfigurationRequestDescriptor() - { - Instance = new Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequest(typeof(TDocument)); - } - - public static explicit operator Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequest instance) => new Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor(instance); - public static implicit operator Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequest(Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor descriptor) => descriptor.Instance; - - /// - /// - /// The name of the index. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName value) - { - Instance.Index = value; - return this; - } - - /// - /// - /// Period to wait for a connection to the master node. If no response is - /// received before the timeout expires, the request fails and returns an - /// error. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? value) - { - Instance.MasterTimeout = value; - return this; - } - - /// - /// - /// Period to wait for a response. - /// If no response is received before the timeout expires, the request fails and returns an error. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? value) - { - Instance.Timeout = value; - return this; - } - - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - internal static Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequest Build(System.Action> action) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor(new Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); - action.Invoke(builder); - return builder.Instance; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor ErrorTrace(bool? value) - { - Instance.ErrorTrace = value; - return this; - } - - [System.Diagnostics.CodeAnalysis.Experimental("ESEXP0001", UrlFormat = "https://www.elastic.co/docs/reference/elasticsearch/clients/dotnet/experimental#{0}" -#if NET10_0_OR_GREATER - , Message = "Use of response filtering can result in a response from Elasticsearch that cannot be correctly deserialized to the respective response type for the request." -#endif - )] - public Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor FilterPath(params string[]? value) - { - Instance.FilterPath = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor Human(bool? value) - { - Instance.Human = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor Pretty(bool? value) - { - Instance.Pretty = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor SourceQueryString(string? value) - { - Instance.SourceQueryString = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) - { - Instance.RequestConfiguration = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor RequestConfiguration(System.Func? configurationSelector) - { - Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; - return this; - } -} \ No newline at end of file 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 123864db54a..a7ec5f51266 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeRequest.g.cs @@ -56,7 +56,7 @@ public sealed partial class ForcemergeRequestParameters : Elastic.Transport.Requ /// /// - /// The number of segments the index should be merged into (defayult: dynamic) + /// The number of segments the index should be merged into (default: dynamic) /// /// public long? MaxNumSegments { get => Q("max_num_segments"); set => Q("max_num_segments", value); } @@ -226,7 +226,7 @@ internal ForcemergeRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// /// - /// The number of segments the index should be merged into (defayult: dynamic) + /// The number of segments the index should be merged into (default: dynamic) /// /// public long? MaxNumSegments { get => Q("max_num_segments"); set => Q("max_num_segments", value); } @@ -425,7 +425,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.ForcemergeRequestDescriptor /// /// - /// The number of segments the index should be merged into (defayult: dynamic) + /// The number of segments the index should be merged into (default: dynamic) /// /// public Elastic.Clients.Elasticsearch.IndexManagement.ForcemergeRequestDescriptor MaxNumSegments(long? value) @@ -696,7 +696,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.ForcemergeRequestDescriptor /// /// - /// The number of segments the index should be merged into (defayult: dynamic) + /// The number of segments the index should be merged into (default: dynamic) /// /// public Elastic.Clients.Elasticsearch.IndexManagement.ForcemergeRequestDescriptor MaxNumSegments(long? value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAllSampleConfigurationRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAllSampleConfigurationRequest.g.cs deleted file mode 100644 index 073db58faa5..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAllSampleConfigurationRequest.g.cs +++ /dev/null @@ -1,175 +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.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.IndexManagement; - -public sealed partial class GetAllSampleConfigurationRequestParameters : Elastic.Transport.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); } -} - -/// -/// -/// Get all sampling configurations. -/// -/// -/// Get the sampling configurations for all indices. -/// -/// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetAllSampleConfigurationRequestConverter))] -public sealed partial class GetAllSampleConfigurationRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest -{ - public GetAllSampleConfigurationRequest() - { - } - - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - internal GetAllSampleConfigurationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) - { - _ = sentinel; - } - - internal override Elastic.Clients.Elasticsearch.Requests.ApiUrls ApiUrls => Elastic.Clients.Elasticsearch.Requests.ApiUrlLookup.IndexManagementGetAllSampleConfiguration; - - protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.GET; - - internal override bool SupportsBody => false; - - internal override string OperationName => "indices.get_all_sample_configuration"; - - /// - /// - /// 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); } -} - -/// -/// -/// Get all sampling configurations. -/// -/// -/// Get the sampling configurations for all indices. -/// -/// -public readonly partial struct GetAllSampleConfigurationRequestDescriptor -{ - internal Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequest Instance { get; init; } - - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public GetAllSampleConfigurationRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequest instance) - { - Instance = instance; - } - - public GetAllSampleConfigurationRequestDescriptor() - { - Instance = new Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); - } - - public static explicit operator Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequest instance) => new Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequestDescriptor(instance); - public static implicit operator Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequest(Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequestDescriptor descriptor) => descriptor.Instance; - - /// - /// - /// 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.IndexManagement.GetAllSampleConfigurationRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? value) - { - Instance.MasterTimeout = value; - return this; - } - - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - internal static Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequest Build(System.Action? action) - { - if (action is null) - { - return new Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); - } - - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequestDescriptor(new Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); - action.Invoke(builder); - return builder.Instance; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequestDescriptor ErrorTrace(bool? value) - { - Instance.ErrorTrace = value; - return this; - } - - [System.Diagnostics.CodeAnalysis.Experimental("ESEXP0001", UrlFormat = "https://www.elastic.co/docs/reference/elasticsearch/clients/dotnet/experimental#{0}" -#if NET10_0_OR_GREATER - , Message = "Use of response filtering can result in a response from Elasticsearch that cannot be correctly deserialized to the respective response type for the request." -#endif - )] - public Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequestDescriptor FilterPath(params string[]? value) - { - Instance.FilterPath = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequestDescriptor Human(bool? value) - { - Instance.Human = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequestDescriptor Pretty(bool? value) - { - Instance.Pretty = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequestDescriptor SourceQueryString(string? value) - { - Instance.SourceQueryString = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) - { - Instance.RequestConfiguration = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequestDescriptor RequestConfiguration(System.Func? configurationSelector) - { - Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; - return this; - } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAllSampleConfigurationResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAllSampleConfigurationResponse.Converters.g.cs deleted file mode 100644 index cf2813ff0d5..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAllSampleConfigurationResponse.Converters.g.cs +++ /dev/null @@ -1,63 +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.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; - -public sealed partial class GetAllSampleConfigurationResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropConfigurations = System.Text.Json.JsonEncodedText.Encode("configurations"u8); - - public override Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propConfigurations = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propConfigurations.TryReadProperty(ref reader, options, PropConfigurations, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.SafeSkip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Configurations = propConfigurations.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropConfigurations, value.Configurations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleConfigurationRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleConfigurationRequest.g.cs deleted file mode 100644 index 9d7b82b73cb..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleConfigurationRequest.g.cs +++ /dev/null @@ -1,310 +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.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.IndexManagement; - -public sealed partial class GetSampleConfigurationRequestParameters : Elastic.Transport.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); } -} - -/// -/// -/// Get sampling configuration. -/// -/// -/// Get the sampling configuration for the specified index. -/// -/// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetSampleConfigurationRequestConverter))] -public sealed partial class GetSampleConfigurationRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest -{ - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public GetSampleConfigurationRequest(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) - { - } - - public GetSampleConfigurationRequest() - { - } - - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - internal GetSampleConfigurationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) - { - _ = sentinel; - } - - internal override Elastic.Clients.Elasticsearch.Requests.ApiUrls ApiUrls => Elastic.Clients.Elasticsearch.Requests.ApiUrlLookup.IndexManagementGetSampleConfiguration; - - protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.GET; - - internal override bool SupportsBody => false; - - internal override string OperationName => "indices.get_sample_configuration"; - - /// - /// - /// The name of the index. - /// - /// - public required Elastic.Clients.Elasticsearch.IndexName Index { get => P("index"); set => PR("index", 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); } -} - -/// -/// -/// Get sampling configuration. -/// -/// -/// Get the sampling configuration for the specified index. -/// -/// -public readonly partial struct GetSampleConfigurationRequestDescriptor -{ - internal Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequest Instance { get; init; } - - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public GetSampleConfigurationRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequest instance) - { - Instance = instance; - } - - public GetSampleConfigurationRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) - { - Instance = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequest(index); - } - - [System.Obsolete("The use of the parameterless constructor is not permitted for this type.")] - public GetSampleConfigurationRequestDescriptor() - { - throw new System.InvalidOperationException("The use of the parameterless constructor is not permitted for this type."); - } - - public static explicit operator Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequest instance) => new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor(instance); - public static implicit operator Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequest(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor descriptor) => descriptor.Instance; - - /// - /// - /// The name of the index. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName value) - { - Instance.Index = value; - return this; - } - - /// - /// - /// Period to wait for a connection to the master node. If no response is - /// received before the timeout expires, the request fails and returns an - /// error. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? value) - { - Instance.MasterTimeout = value; - return this; - } - - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - internal static Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequest Build(System.Action action) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor(new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); - action.Invoke(builder); - return builder.Instance; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor ErrorTrace(bool? value) - { - Instance.ErrorTrace = value; - return this; - } - - [System.Diagnostics.CodeAnalysis.Experimental("ESEXP0001", UrlFormat = "https://www.elastic.co/docs/reference/elasticsearch/clients/dotnet/experimental#{0}" -#if NET10_0_OR_GREATER - , Message = "Use of response filtering can result in a response from Elasticsearch that cannot be correctly deserialized to the respective response type for the request." -#endif - )] - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor FilterPath(params string[]? value) - { - Instance.FilterPath = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor Human(bool? value) - { - Instance.Human = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor Pretty(bool? value) - { - Instance.Pretty = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor SourceQueryString(string? value) - { - Instance.SourceQueryString = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) - { - Instance.RequestConfiguration = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor RequestConfiguration(System.Func? configurationSelector) - { - Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; - return this; - } -} - -/// -/// -/// Get sampling configuration. -/// -/// -/// Get the sampling configuration for the specified index. -/// -/// -public readonly partial struct GetSampleConfigurationRequestDescriptor -{ - internal Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequest Instance { get; init; } - - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public GetSampleConfigurationRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequest instance) - { - Instance = instance; - } - - public GetSampleConfigurationRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) - { - Instance = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequest(index); - } - - public GetSampleConfigurationRequestDescriptor() - { - Instance = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequest(typeof(TDocument)); - } - - public static explicit operator Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequest instance) => new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor(instance); - public static implicit operator Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequest(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor descriptor) => descriptor.Instance; - - /// - /// - /// The name of the index. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName value) - { - Instance.Index = value; - return this; - } - - /// - /// - /// Period to wait for a connection to the master node. If no response is - /// received before the timeout expires, the request fails and returns an - /// error. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? value) - { - Instance.MasterTimeout = value; - return this; - } - - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - internal static Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequest Build(System.Action> action) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor(new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); - action.Invoke(builder); - return builder.Instance; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor ErrorTrace(bool? value) - { - Instance.ErrorTrace = value; - return this; - } - - [System.Diagnostics.CodeAnalysis.Experimental("ESEXP0001", UrlFormat = "https://www.elastic.co/docs/reference/elasticsearch/clients/dotnet/experimental#{0}" -#if NET10_0_OR_GREATER - , Message = "Use of response filtering can result in a response from Elasticsearch that cannot be correctly deserialized to the respective response type for the request." -#endif - )] - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor FilterPath(params string[]? value) - { - Instance.FilterPath = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor Human(bool? value) - { - Instance.Human = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor Pretty(bool? value) - { - Instance.Pretty = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor SourceQueryString(string? value) - { - Instance.SourceQueryString = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) - { - Instance.RequestConfiguration = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor RequestConfiguration(System.Func? configurationSelector) - { - Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; - return this; - } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleConfigurationResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleConfigurationResponse.Converters.g.cs deleted file mode 100644 index 25dd4de27aa..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleConfigurationResponse.Converters.g.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. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using System; -using System.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; - -public sealed partial class GetSampleConfigurationResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropConfiguration = System.Text.Json.JsonEncodedText.Encode("configuration"u8); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"u8); - - public override Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propConfiguration = default; - LocalJsonValue propIndex = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propConfiguration.TryReadProperty(ref reader, options, PropConfiguration, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.SafeSkip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Configuration = propConfiguration.Value, - Index = propIndex.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropConfiguration, value.Configuration, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteEndObject(); - } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleRequest.g.cs deleted file mode 100644 index 247e275287a..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleRequest.g.cs +++ /dev/null @@ -1,258 +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.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.IndexManagement; - -public sealed partial class GetSampleRequestParameters : Elastic.Transport.RequestParameters -{ -} - -/// -/// -/// Request for a random sample of raw documents ingested into the given index or data stream. -/// -/// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetSampleRequestConverter))] -public sealed partial class GetSampleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest -{ - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public GetSampleRequest(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) - { - } - - public GetSampleRequest() - { - } - - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - internal GetSampleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) - { - _ = sentinel; - } - - internal override Elastic.Clients.Elasticsearch.Requests.ApiUrls ApiUrls => Elastic.Clients.Elasticsearch.Requests.ApiUrlLookup.IndexManagementGetSample; - - protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.GET; - - internal override bool SupportsBody => false; - - internal override string OperationName => "indices.get_sample"; - - /// - /// - /// Single index or data stream name. Wildcards are not supported. - /// - /// - public required Elastic.Clients.Elasticsearch.IndexName Index { get => P("index"); set => PR("index", value); } -} - -/// -/// -/// Request for a random sample of raw documents ingested into the given index or data stream. -/// -/// -public readonly partial struct GetSampleRequestDescriptor -{ - internal Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest Instance { get; init; } - - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public GetSampleRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest instance) - { - Instance = instance; - } - - public GetSampleRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) - { - Instance = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest(index); - } - - [System.Obsolete("The use of the parameterless constructor is not permitted for this type.")] - public GetSampleRequestDescriptor() - { - throw new System.InvalidOperationException("The use of the parameterless constructor is not permitted for this type."); - } - - public static explicit operator Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest instance) => new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(instance); - public static implicit operator Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor descriptor) => descriptor.Instance; - - /// - /// - /// Single index or data stream name. Wildcards are not supported. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName value) - { - Instance.Index = value; - return this; - } - - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - internal static Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest Build(System.Action action) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); - action.Invoke(builder); - return builder.Instance; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor ErrorTrace(bool? value) - { - Instance.ErrorTrace = value; - return this; - } - - [System.Diagnostics.CodeAnalysis.Experimental("ESEXP0001", UrlFormat = "https://www.elastic.co/docs/reference/elasticsearch/clients/dotnet/experimental#{0}" -#if NET10_0_OR_GREATER - , Message = "Use of response filtering can result in a response from Elasticsearch that cannot be correctly deserialized to the respective response type for the request." -#endif - )] - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor FilterPath(params string[]? value) - { - Instance.FilterPath = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor Human(bool? value) - { - Instance.Human = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor Pretty(bool? value) - { - Instance.Pretty = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor SourceQueryString(string? value) - { - Instance.SourceQueryString = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) - { - Instance.RequestConfiguration = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor RequestConfiguration(System.Func? configurationSelector) - { - Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; - return this; - } -} - -/// -/// -/// Request for a random sample of raw documents ingested into the given index or data stream. -/// -/// -public readonly partial struct GetSampleRequestDescriptor -{ - internal Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest Instance { get; init; } - - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public GetSampleRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest instance) - { - Instance = instance; - } - - public GetSampleRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) - { - Instance = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest(index); - } - - public GetSampleRequestDescriptor() - { - Instance = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest(typeof(TDocument)); - } - - public static explicit operator Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest instance) => new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(instance); - public static implicit operator Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor descriptor) => descriptor.Instance; - - /// - /// - /// Single index or data stream name. Wildcards are not supported. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName value) - { - Instance.Index = value; - return this; - } - - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - internal static Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest Build(System.Action> action) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); - action.Invoke(builder); - return builder.Instance; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor ErrorTrace(bool? value) - { - Instance.ErrorTrace = value; - return this; - } - - [System.Diagnostics.CodeAnalysis.Experimental("ESEXP0001", UrlFormat = "https://www.elastic.co/docs/reference/elasticsearch/clients/dotnet/experimental#{0}" -#if NET10_0_OR_GREATER - , Message = "Use of response filtering can result in a response from Elasticsearch that cannot be correctly deserialized to the respective response type for the request." -#endif - )] - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor FilterPath(params string[]? value) - { - Instance.FilterPath = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor Human(bool? value) - { - Instance.Human = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor Pretty(bool? value) - { - Instance.Pretty = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor SourceQueryString(string? value) - { - Instance.SourceQueryString = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) - { - Instance.RequestConfiguration = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor RequestConfiguration(System.Func? configurationSelector) - { - Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; - return this; - } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsRequest.g.cs deleted file mode 100644 index b410a5ceb9f..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsRequest.g.cs +++ /dev/null @@ -1,258 +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.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.IndexManagement; - -public sealed partial class GetSampleStatsRequestParameters : Elastic.Transport.RequestParameters -{ -} - -/// -/// -/// Request stats for a random sample of raw documents ingested into the given index or data stream. -/// -/// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetSampleStatsRequestConverter))] -public sealed partial class GetSampleStatsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest -{ - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public GetSampleStatsRequest(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) - { - } - - public GetSampleStatsRequest() - { - } - - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - internal GetSampleStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) - { - _ = sentinel; - } - - internal override Elastic.Clients.Elasticsearch.Requests.ApiUrls ApiUrls => Elastic.Clients.Elasticsearch.Requests.ApiUrlLookup.IndexManagementGetSampleStats; - - protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.GET; - - internal override bool SupportsBody => false; - - internal override string OperationName => "indices.get_sample_stats"; - - /// - /// - /// Single index or data stream name. Wildcards are not supported. - /// - /// - public required Elastic.Clients.Elasticsearch.IndexName Index { get => P("index"); set => PR("index", value); } -} - -/// -/// -/// Request stats for a random sample of raw documents ingested into the given index or data stream. -/// -/// -public readonly partial struct GetSampleStatsRequestDescriptor -{ - internal Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest Instance { get; init; } - - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public GetSampleStatsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest instance) - { - Instance = instance; - } - - public GetSampleStatsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) - { - Instance = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest(index); - } - - [System.Obsolete("The use of the parameterless constructor is not permitted for this type.")] - public GetSampleStatsRequestDescriptor() - { - throw new System.InvalidOperationException("The use of the parameterless constructor is not permitted for this type."); - } - - public static explicit operator Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest instance) => new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(instance); - public static implicit operator Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor descriptor) => descriptor.Instance; - - /// - /// - /// Single index or data stream name. Wildcards are not supported. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName value) - { - Instance.Index = value; - return this; - } - - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - internal static Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest Build(System.Action action) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); - action.Invoke(builder); - return builder.Instance; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor ErrorTrace(bool? value) - { - Instance.ErrorTrace = value; - return this; - } - - [System.Diagnostics.CodeAnalysis.Experimental("ESEXP0001", UrlFormat = "https://www.elastic.co/docs/reference/elasticsearch/clients/dotnet/experimental#{0}" -#if NET10_0_OR_GREATER - , Message = "Use of response filtering can result in a response from Elasticsearch that cannot be correctly deserialized to the respective response type for the request." -#endif - )] - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor FilterPath(params string[]? value) - { - Instance.FilterPath = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor Human(bool? value) - { - Instance.Human = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor Pretty(bool? value) - { - Instance.Pretty = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor SourceQueryString(string? value) - { - Instance.SourceQueryString = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) - { - Instance.RequestConfiguration = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor RequestConfiguration(System.Func? configurationSelector) - { - Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; - return this; - } -} - -/// -/// -/// Request stats for a random sample of raw documents ingested into the given index or data stream. -/// -/// -public readonly partial struct GetSampleStatsRequestDescriptor -{ - internal Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest Instance { get; init; } - - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public GetSampleStatsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest instance) - { - Instance = instance; - } - - public GetSampleStatsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) - { - Instance = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest(index); - } - - public GetSampleStatsRequestDescriptor() - { - Instance = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest(typeof(TDocument)); - } - - public static explicit operator Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest instance) => new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(instance); - public static implicit operator Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor descriptor) => descriptor.Instance; - - /// - /// - /// Single index or data stream name. Wildcards are not supported. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName value) - { - Instance.Index = value; - return this; - } - - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - internal static Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest Build(System.Action> action) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); - action.Invoke(builder); - return builder.Instance; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor ErrorTrace(bool? value) - { - Instance.ErrorTrace = value; - return this; - } - - [System.Diagnostics.CodeAnalysis.Experimental("ESEXP0001", UrlFormat = "https://www.elastic.co/docs/reference/elasticsearch/clients/dotnet/experimental#{0}" -#if NET10_0_OR_GREATER - , Message = "Use of response filtering can result in a response from Elasticsearch that cannot be correctly deserialized to the respective response type for the request." -#endif - )] - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor FilterPath(params string[]? value) - { - Instance.FilterPath = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor Human(bool? value) - { - Instance.Human = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor Pretty(bool? value) - { - Instance.Pretty = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor SourceQueryString(string? value) - { - Instance.SourceQueryString = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) - { - Instance.RequestConfiguration = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor RequestConfiguration(System.Func? configurationSelector) - { - Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; - return this; - } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsResponse.Converters.g.cs deleted file mode 100644 index 018ee5bdb27..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsResponse.Converters.g.cs +++ /dev/null @@ -1,180 +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.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; - -public sealed partial class GetSampleStatsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLastException = System.Text.Json.JsonEncodedText.Encode("last_exception"u8); - private static readonly System.Text.Json.JsonEncodedText PropPotentialSamples = System.Text.Json.JsonEncodedText.Encode("potential_samples"u8); - private static readonly System.Text.Json.JsonEncodedText PropSamplesAccepted = System.Text.Json.JsonEncodedText.Encode("samples_accepted"u8); - private static readonly System.Text.Json.JsonEncodedText PropSamplesRejectedForCondition = System.Text.Json.JsonEncodedText.Encode("samples_rejected_for_condition"u8); - private static readonly System.Text.Json.JsonEncodedText PropSamplesRejectedForException = System.Text.Json.JsonEncodedText.Encode("samples_rejected_for_exception"u8); - private static readonly System.Text.Json.JsonEncodedText PropSamplesRejectedForMaxSamplesExceeded = System.Text.Json.JsonEncodedText.Encode("samples_rejected_for_max_samples_exceeded"u8); - private static readonly System.Text.Json.JsonEncodedText PropSamplesRejectedForRate = System.Text.Json.JsonEncodedText.Encode("samples_rejected_for_rate"u8); - private static readonly System.Text.Json.JsonEncodedText PropSamplesRejectedForSize = System.Text.Json.JsonEncodedText.Encode("samples_rejected_for_size"u8); - private static readonly System.Text.Json.JsonEncodedText PropTimeCompilingCondition = System.Text.Json.JsonEncodedText.Encode("time_compiling_condition"u8); - private static readonly System.Text.Json.JsonEncodedText PropTimeCompilingConditionMillis = System.Text.Json.JsonEncodedText.Encode("time_compiling_condition_millis"u8); - private static readonly System.Text.Json.JsonEncodedText PropTimeEvaluatingCondition = System.Text.Json.JsonEncodedText.Encode("time_evaluating_condition"u8); - private static readonly System.Text.Json.JsonEncodedText PropTimeEvaluatingConditionMillis = System.Text.Json.JsonEncodedText.Encode("time_evaluating_condition_millis"u8); - private static readonly System.Text.Json.JsonEncodedText PropTimeSampling = System.Text.Json.JsonEncodedText.Encode("time_sampling"u8); - private static readonly System.Text.Json.JsonEncodedText PropTimeSamplingMillis = System.Text.Json.JsonEncodedText.Encode("time_sampling_millis"u8); - - public override Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLastException = default; - LocalJsonValue propPotentialSamples = default; - LocalJsonValue propSamplesAccepted = default; - LocalJsonValue propSamplesRejectedForCondition = default; - LocalJsonValue propSamplesRejectedForException = default; - LocalJsonValue propSamplesRejectedForMaxSamplesExceeded = default; - LocalJsonValue propSamplesRejectedForRate = default; - LocalJsonValue propSamplesRejectedForSize = default; - LocalJsonValue propTimeCompilingCondition = default; - LocalJsonValue propTimeCompilingConditionMillis = default; - LocalJsonValue propTimeEvaluatingCondition = default; - LocalJsonValue propTimeEvaluatingConditionMillis = default; - LocalJsonValue propTimeSampling = default; - LocalJsonValue propTimeSamplingMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLastException.TryReadProperty(ref reader, options, PropLastException, null)) - { - continue; - } - - if (propPotentialSamples.TryReadProperty(ref reader, options, PropPotentialSamples, null)) - { - continue; - } - - if (propSamplesAccepted.TryReadProperty(ref reader, options, PropSamplesAccepted, null)) - { - continue; - } - - if (propSamplesRejectedForCondition.TryReadProperty(ref reader, options, PropSamplesRejectedForCondition, null)) - { - continue; - } - - if (propSamplesRejectedForException.TryReadProperty(ref reader, options, PropSamplesRejectedForException, null)) - { - continue; - } - - if (propSamplesRejectedForMaxSamplesExceeded.TryReadProperty(ref reader, options, PropSamplesRejectedForMaxSamplesExceeded, null)) - { - continue; - } - - if (propSamplesRejectedForRate.TryReadProperty(ref reader, options, PropSamplesRejectedForRate, null)) - { - continue; - } - - if (propSamplesRejectedForSize.TryReadProperty(ref reader, options, PropSamplesRejectedForSize, null)) - { - continue; - } - - if (propTimeCompilingCondition.TryReadProperty(ref reader, options, PropTimeCompilingCondition, null)) - { - continue; - } - - if (propTimeCompilingConditionMillis.TryReadProperty(ref reader, options, PropTimeCompilingConditionMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTimeEvaluatingCondition.TryReadProperty(ref reader, options, PropTimeEvaluatingCondition, null)) - { - continue; - } - - if (propTimeEvaluatingConditionMillis.TryReadProperty(ref reader, options, PropTimeEvaluatingConditionMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTimeSampling.TryReadProperty(ref reader, options, PropTimeSampling, null)) - { - continue; - } - - if (propTimeSamplingMillis.TryReadProperty(ref reader, options, PropTimeSamplingMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.SafeSkip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - LastException = propLastException.Value, - PotentialSamples = propPotentialSamples.Value, - SamplesAccepted = propSamplesAccepted.Value, - SamplesRejectedForCondition = propSamplesRejectedForCondition.Value, - SamplesRejectedForException = propSamplesRejectedForException.Value, - SamplesRejectedForMaxSamplesExceeded = propSamplesRejectedForMaxSamplesExceeded.Value, - SamplesRejectedForRate = propSamplesRejectedForRate.Value, - SamplesRejectedForSize = propSamplesRejectedForSize.Value, - TimeCompilingCondition = propTimeCompilingCondition.Value, - TimeCompilingConditionMillis = propTimeCompilingConditionMillis.Value, - TimeEvaluatingCondition = propTimeEvaluatingCondition.Value, - TimeEvaluatingConditionMillis = propTimeEvaluatingConditionMillis.Value, - TimeSampling = propTimeSampling.Value, - TimeSamplingMillis = propTimeSamplingMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLastException, value.LastException, null, null); - writer.WriteProperty(options, PropPotentialSamples, value.PotentialSamples, null, null); - writer.WriteProperty(options, PropSamplesAccepted, value.SamplesAccepted, null, null); - writer.WriteProperty(options, PropSamplesRejectedForCondition, value.SamplesRejectedForCondition, null, null); - writer.WriteProperty(options, PropSamplesRejectedForException, value.SamplesRejectedForException, null, null); - writer.WriteProperty(options, PropSamplesRejectedForMaxSamplesExceeded, value.SamplesRejectedForMaxSamplesExceeded, null, null); - writer.WriteProperty(options, PropSamplesRejectedForRate, value.SamplesRejectedForRate, null, null); - writer.WriteProperty(options, PropSamplesRejectedForSize, value.SamplesRejectedForSize, null, null); - writer.WriteProperty(options, PropTimeCompilingCondition, value.TimeCompilingCondition, null, null); - writer.WriteProperty(options, PropTimeCompilingConditionMillis, value.TimeCompilingConditionMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTimeEvaluatingCondition, value.TimeEvaluatingCondition, null, null); - writer.WriteProperty(options, PropTimeEvaluatingConditionMillis, value.TimeEvaluatingConditionMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTimeSampling, value.TimeSampling, null, null); - writer.WriteProperty(options, PropTimeSamplingMillis, value.TimeSamplingMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasRequest.Converters.g.cs index b892f3b82f6..483758a744c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasRequest.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasRequest.Converters.g.cs @@ -35,10 +35,10 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.PutAliasRequest Re { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propFilter = default; - LocalJsonValue propIndexRouting = default; + LocalJsonValue propIndexRouting = default; LocalJsonValue propIsWriteIndex = default; - LocalJsonValue propRouting = default; - LocalJsonValue propSearchRouting = default; + LocalJsonValue propRouting = default; + LocalJsonValue propSearchRouting = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) 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 6911ba56d32..5f0e904dbaa 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasRequest.g.cs @@ -124,7 +124,7 @@ internal PutAliasRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstru /// Data stream aliases don’t support this parameter. /// /// - public Elastic.Clients.Elasticsearch.Routing? IndexRouting { get; set; } + public string? IndexRouting { get; set; } /// /// @@ -142,7 +142,7 @@ internal PutAliasRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstru /// Data stream aliases don’t support this parameter. /// /// - public Elastic.Clients.Elasticsearch.Routing? Routing { get; set; } + public string? Routing { get; set; } /// /// @@ -151,7 +151,7 @@ internal PutAliasRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstru /// Data stream aliases don’t support this parameter. /// /// - public Elastic.Clients.Elasticsearch.Routing? SearchRouting { get; set; } + public string? SearchRouting { get; set; } } /// @@ -276,7 +276,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.PutAliasRequestDescriptor F /// Data stream aliases don’t support this parameter. /// /// - public Elastic.Clients.Elasticsearch.IndexManagement.PutAliasRequestDescriptor IndexRouting(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.IndexManagement.PutAliasRequestDescriptor IndexRouting(string? value) { Instance.IndexRouting = value; return this; @@ -302,7 +302,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.PutAliasRequestDescriptor I /// Data stream aliases don’t support this parameter. /// /// - public Elastic.Clients.Elasticsearch.IndexManagement.PutAliasRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.IndexManagement.PutAliasRequestDescriptor Routing(string? value) { Instance.Routing = value; return this; @@ -315,7 +315,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.PutAliasRequestDescriptor R /// Data stream aliases don’t support this parameter. /// /// - public Elastic.Clients.Elasticsearch.IndexManagement.PutAliasRequestDescriptor SearchRouting(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.IndexManagement.PutAliasRequestDescriptor SearchRouting(string? value) { Instance.SearchRouting = value; return this; @@ -488,7 +488,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.PutAliasRequestDescriptor /// - public Elastic.Clients.Elasticsearch.IndexManagement.PutAliasRequestDescriptor IndexRouting(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.IndexManagement.PutAliasRequestDescriptor IndexRouting(string? value) { Instance.IndexRouting = value; return this; @@ -514,7 +514,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.PutAliasRequestDescriptor /// - public Elastic.Clients.Elasticsearch.IndexManagement.PutAliasRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.IndexManagement.PutAliasRequestDescriptor Routing(string? value) { Instance.Routing = value; return this; @@ -527,7 +527,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.PutAliasRequestDescriptor /// - public Elastic.Clients.Elasticsearch.IndexManagement.PutAliasRequestDescriptor SearchRouting(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.IndexManagement.PutAliasRequestDescriptor SearchRouting(string? value) { Instance.SearchRouting = value; return this; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamSettingsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamSettingsRequest.g.cs index df0eb4d59c8..8142e52b5bb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamSettingsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamSettingsRequest.g.cs @@ -57,6 +57,9 @@ public sealed partial class PutDataStreamSettingsRequestParameters : Elastic.Tra /// Update data stream settings. /// /// +/// NOTE: Available in 8.19. Not available in earlier versions. +/// +/// /// This API can be used to override settings on specific data streams. These overrides will take precedence over what /// is specified in the template that the data stream matches. To prevent your data stream from getting into an invalid state, /// only certain settings are allowed. If possible, the setting change is applied to all @@ -136,6 +139,9 @@ internal PutDataStreamSettingsRequest(Elastic.Clients.Elasticsearch.Serializatio /// Update data stream settings. /// /// +/// NOTE: Available in 8.19. Not available in earlier versions. +/// +/// /// This API can be used to override settings on specific data streams. These overrides will take precedence over what /// is specified in the template that the data stream matches. To prevent your data stream from getting into an invalid state, /// only certain settings are allowed. If possible, the setting change is applied to all @@ -302,6 +308,9 @@ public Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamSettingsReques /// Update data stream settings. /// /// +/// NOTE: Available in 8.19. Not available in earlier versions. +/// +/// /// This API can be used to override settings on specific data streams. These overrides will take precedence over what /// is specified in the template that the data stream matches. To prevent your data stream from getting into an invalid state, /// only certain settings are allowed. If possible, the setting change is applied to all 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 db9dfd38d2c..2f0a03601cd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateRequest.g.cs @@ -188,7 +188,7 @@ internal PutIndexTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.Jso /// /// - /// Name of the index template to create. + /// Array of wildcard (*) expressions used to match the names of data streams and indices during creation. /// /// public Elastic.Clients.Elasticsearch.Indices? IndexPatterns { get; set; } @@ -457,7 +457,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.PutIndexTemplateRequestDesc /// /// - /// Name of the index template to create. + /// Array of wildcard (*) expressions used to match the names of data streams and indices during creation. /// /// public Elastic.Clients.Elasticsearch.IndexManagement.PutIndexTemplateRequestDescriptor IndexPatterns(Elastic.Clients.Elasticsearch.Indices? value) @@ -874,7 +874,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.PutIndexTemplateRequestDesc /// /// - /// Name of the index template to create. + /// Array of wildcard (*) expressions used to match the names of data streams and indices during creation. /// /// public Elastic.Clients.Elasticsearch.IndexManagement.PutIndexTemplateRequestDescriptor IndexPatterns(Elastic.Clients.Elasticsearch.Indices? value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutSampleConfigurationRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutSampleConfigurationRequest.Converters.g.cs deleted file mode 100644 index 1225b576ca0..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutSampleConfigurationRequest.Converters.g.cs +++ /dev/null @@ -1,99 +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.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; - -public sealed partial class PutSampleConfigurationRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"u8); - private static readonly System.Text.Json.JsonEncodedText PropMaxSamples = System.Text.Json.JsonEncodedText.Encode("max_samples"u8); - private static readonly System.Text.Json.JsonEncodedText PropMaxSize = System.Text.Json.JsonEncodedText.Encode("max_size"u8); - private static readonly System.Text.Json.JsonEncodedText PropRate = System.Text.Json.JsonEncodedText.Encode("rate"u8); - private static readonly System.Text.Json.JsonEncodedText PropTimeToLive = System.Text.Json.JsonEncodedText.Encode("time_to_live"u8); - - public override Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIf = default; - LocalJsonValue propMaxSamples = default; - LocalJsonValue propMaxSize = default; - LocalJsonValue propRate = default; - LocalJsonValue propTimeToLive = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propMaxSamples.TryReadProperty(ref reader, options, PropMaxSamples, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxSize.TryReadProperty(ref reader, options, PropMaxSize, null)) - { - continue; - } - - if (propRate.TryReadProperty(ref reader, options, PropRate, null)) - { - continue; - } - - if (propTimeToLive.TryReadProperty(ref reader, options, PropTimeToLive, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.SafeSkip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - If = propIf.Value, - MaxSamples = propMaxSamples.Value, - MaxSize = propMaxSize.Value, - Rate = propRate.Value, - TimeToLive = propTimeToLive.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropMaxSamples, value.MaxSamples, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxSize, value.MaxSize, null, null); - writer.WriteProperty(options, PropRate, value.Rate, null, null); - writer.WriteProperty(options, PropTimeToLive, value.TimeToLive, null, null); - writer.WriteEndObject(); - } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutSampleConfigurationRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutSampleConfigurationRequest.g.cs deleted file mode 100644 index 9af53689d70..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutSampleConfigurationRequest.g.cs +++ /dev/null @@ -1,536 +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.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.IndexManagement; - -public sealed partial class PutSampleConfigurationRequestParameters : Elastic.Transport.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); } -} - -/// -/// -/// Create or update sampling configuration. -/// -/// -/// Create or update the sampling configuration for the specified index. -/// -/// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.PutSampleConfigurationRequestConverter))] -public sealed partial class PutSampleConfigurationRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest -{ - [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public PutSampleConfigurationRequest(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) - { - } - - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public PutSampleConfigurationRequest(Elastic.Clients.Elasticsearch.IndexName index, double rate) : base(r => r.Required("index", index)) - { - Rate = rate; - } - - public PutSampleConfigurationRequest() - { - } - - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - internal PutSampleConfigurationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) - { - _ = sentinel; - } - - internal override Elastic.Clients.Elasticsearch.Requests.ApiUrls ApiUrls => Elastic.Clients.Elasticsearch.Requests.ApiUrlLookup.IndexManagementPutSampleConfiguration; - - protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.PUT; - - internal override bool SupportsBody => true; - - internal override string OperationName => "indices.put_sample_configuration"; - - /// - /// - /// The name of the index or data stream. - /// - /// - public required Elastic.Clients.Elasticsearch.IndexName Index { get => P("index"); set => PR("index", 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); } - - /// - /// - /// An optional condition script that sampled documents must satisfy. - /// - /// - public string? If { get; set; } - - /// - /// - /// The maximum number of documents to sample. Must be greater than 0 and less than or equal to 10,000. - /// - /// - public int? MaxSamples { get; set; } - - /// - /// - /// The maximum total size of sampled documents. Must be greater than 0 and less than or equal to 5GB. - /// - /// - public Elastic.Clients.Elasticsearch.ByteSize? MaxSize { get; set; } - - /// - /// - /// The fraction of documents to sample. Must be greater than 0 and less than or equal to 1. - /// Can be specified as a number or a string. - /// - /// - public required double Rate { get; set; } - - /// - /// - /// The duration for which the sampled documents should be retained. - /// Must be greater than 0 and less than or equal to 30 days. - /// - /// - public Elastic.Clients.Elasticsearch.Duration? TimeToLive { get; set; } -} - -/// -/// -/// Create or update sampling configuration. -/// -/// -/// Create or update the sampling configuration for the specified index. -/// -/// -public readonly partial struct PutSampleConfigurationRequestDescriptor -{ - internal Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequest Instance { get; init; } - - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public PutSampleConfigurationRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequest instance) - { - Instance = instance; - } - - public PutSampleConfigurationRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) - { -#pragma warning disable CS0618 - Instance = new Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequest(index); -#pragma warning restore CS0618 - } - - [System.Obsolete("The use of the parameterless constructor is not permitted for this type.")] - public PutSampleConfigurationRequestDescriptor() - { - throw new System.InvalidOperationException("The use of the parameterless constructor is not permitted for this type."); - } - - public static explicit operator Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequest instance) => new Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor(instance); - public static implicit operator Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequest(Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor descriptor) => descriptor.Instance; - - /// - /// - /// The name of the index or data stream. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName value) - { - Instance.Index = value; - return this; - } - - /// - /// - /// Period to wait for a connection to the master node. If no response is - /// received before the timeout expires, the request fails and returns an - /// error. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? value) - { - Instance.MasterTimeout = value; - return this; - } - - /// - /// - /// Period to wait for a response. - /// If no response is received before the timeout expires, the request fails and returns an error. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? value) - { - Instance.Timeout = value; - return this; - } - - /// - /// - /// An optional condition script that sampled documents must satisfy. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor If(string? value) - { - Instance.If = value; - return this; - } - - /// - /// - /// The maximum number of documents to sample. Must be greater than 0 and less than or equal to 10,000. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor MaxSamples(int? value) - { - Instance.MaxSamples = value; - return this; - } - - /// - /// - /// The maximum total size of sampled documents. Must be greater than 0 and less than or equal to 5GB. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor MaxSize(Elastic.Clients.Elasticsearch.ByteSize? value) - { - Instance.MaxSize = value; - return this; - } - - /// - /// - /// The maximum total size of sampled documents. Must be greater than 0 and less than or equal to 5GB. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor MaxSize(System.Func action) - { - Instance.MaxSize = Elastic.Clients.Elasticsearch.ByteSizeFactory.Build(action); - return this; - } - - /// - /// - /// The fraction of documents to sample. Must be greater than 0 and less than or equal to 1. - /// Can be specified as a number or a string. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor Rate(double value) - { - Instance.Rate = value; - return this; - } - - /// - /// - /// The duration for which the sampled documents should be retained. - /// Must be greater than 0 and less than or equal to 30 days. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor TimeToLive(Elastic.Clients.Elasticsearch.Duration? value) - { - Instance.TimeToLive = value; - return this; - } - - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - internal static Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequest Build(System.Action action) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor(new Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); - action.Invoke(builder); - return builder.Instance; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor ErrorTrace(bool? value) - { - Instance.ErrorTrace = value; - return this; - } - - [System.Diagnostics.CodeAnalysis.Experimental("ESEXP0001", UrlFormat = "https://www.elastic.co/docs/reference/elasticsearch/clients/dotnet/experimental#{0}" -#if NET10_0_OR_GREATER - , Message = "Use of response filtering can result in a response from Elasticsearch that cannot be correctly deserialized to the respective response type for the request." -#endif - )] - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor FilterPath(params string[]? value) - { - Instance.FilterPath = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor Human(bool? value) - { - Instance.Human = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor Pretty(bool? value) - { - Instance.Pretty = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor SourceQueryString(string? value) - { - Instance.SourceQueryString = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) - { - Instance.RequestConfiguration = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor RequestConfiguration(System.Func? configurationSelector) - { - Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; - return this; - } -} - -/// -/// -/// Create or update sampling configuration. -/// -/// -/// Create or update the sampling configuration for the specified index. -/// -/// -public readonly partial struct PutSampleConfigurationRequestDescriptor -{ - internal Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequest Instance { get; init; } - - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public PutSampleConfigurationRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequest instance) - { - Instance = instance; - } - - public PutSampleConfigurationRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) - { -#pragma warning disable CS0618 - Instance = new Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequest(index); -#pragma warning restore CS0618 - } - - public PutSampleConfigurationRequestDescriptor() - { -#pragma warning disable CS0618 - Instance = new Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequest(typeof(TDocument)); -#pragma warning restore CS0618 - } - - public static explicit operator Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequest instance) => new Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor(instance); - public static implicit operator Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequest(Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor descriptor) => descriptor.Instance; - - /// - /// - /// The name of the index or data stream. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName value) - { - Instance.Index = value; - return this; - } - - /// - /// - /// Period to wait for a connection to the master node. If no response is - /// received before the timeout expires, the request fails and returns an - /// error. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? value) - { - Instance.MasterTimeout = value; - return this; - } - - /// - /// - /// Period to wait for a response. - /// If no response is received before the timeout expires, the request fails and returns an error. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? value) - { - Instance.Timeout = value; - return this; - } - - /// - /// - /// An optional condition script that sampled documents must satisfy. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor If(string? value) - { - Instance.If = value; - return this; - } - - /// - /// - /// The maximum number of documents to sample. Must be greater than 0 and less than or equal to 10,000. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor MaxSamples(int? value) - { - Instance.MaxSamples = value; - return this; - } - - /// - /// - /// The maximum total size of sampled documents. Must be greater than 0 and less than or equal to 5GB. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor MaxSize(Elastic.Clients.Elasticsearch.ByteSize? value) - { - Instance.MaxSize = value; - return this; - } - - /// - /// - /// The maximum total size of sampled documents. Must be greater than 0 and less than or equal to 5GB. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor MaxSize(System.Func action) - { - Instance.MaxSize = Elastic.Clients.Elasticsearch.ByteSizeFactory.Build(action); - return this; - } - - /// - /// - /// The fraction of documents to sample. Must be greater than 0 and less than or equal to 1. - /// Can be specified as a number or a string. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor Rate(double value) - { - Instance.Rate = value; - return this; - } - - /// - /// - /// The duration for which the sampled documents should be retained. - /// Must be greater than 0 and less than or equal to 30 days. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor TimeToLive(Elastic.Clients.Elasticsearch.Duration? value) - { - Instance.TimeToLive = value; - return this; - } - - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - internal static Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequest Build(System.Action> action) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor(new Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); - action.Invoke(builder); - return builder.Instance; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor ErrorTrace(bool? value) - { - Instance.ErrorTrace = value; - return this; - } - - [System.Diagnostics.CodeAnalysis.Experimental("ESEXP0001", UrlFormat = "https://www.elastic.co/docs/reference/elasticsearch/clients/dotnet/experimental#{0}" -#if NET10_0_OR_GREATER - , Message = "Use of response filtering can result in a response from Elasticsearch that cannot be correctly deserialized to the respective response type for the request." -#endif - )] - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor FilterPath(params string[]? value) - { - Instance.FilterPath = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor Human(bool? value) - { - Instance.Human = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor Pretty(bool? value) - { - Instance.Pretty = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor SourceQueryString(string? value) - { - Instance.SourceQueryString = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) - { - Instance.RequestConfiguration = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor RequestConfiguration(System.Func? configurationSelector) - { - Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; - return this; - } -} \ 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 82cfdeaedb5..450f7e583e9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShrinkIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShrinkIndexRequest.g.cs @@ -88,6 +88,9 @@ public sealed partial class ShrinkIndexRequestParameters : Elastic.Transport.Req /// Before shrinking, a (primary or replica) copy of every shard in the index must be present on the same node. /// /// +/// IMPORTANT: If the source index already has one primary shard, configuring the shrink operation with 'index.number_of_shards: 1' will cause the request to fail. An index with one primary shard cannot be shrunk further. +/// +/// /// The current write index on a data stream cannot be shrunk. In order to shrink the current write index, the data stream must first be rolled over so that a new write index is created and then the previous write index can be shrunk. /// /// @@ -259,6 +262,9 @@ internal ShrinkIndexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonCons /// Before shrinking, a (primary or replica) copy of every shard in the index must be present on the same node. /// /// +/// IMPORTANT: If the source index already has one primary shard, configuring the shrink operation with 'index.number_of_shards: 1' will cause the request to fail. An index with one primary shard cannot be shrunk further. +/// +/// /// The current write index on a data stream cannot be shrunk. In order to shrink the current write index, the data stream must first be rolled over so that a new write index is created and then the previous write index can be shrunk. /// /// @@ -634,6 +640,9 @@ public Elastic.Clients.Elasticsearch.IndexManagement.ShrinkIndexRequestDescripto /// Before shrinking, a (primary or replica) copy of every shard in the index must be present on the same node. /// /// +/// IMPORTANT: If the source index already has one primary shard, configuring the shrink operation with 'index.number_of_shards: 1' will cause the request to fail. An index with one primary shard cannot be shrunk further. +/// +/// /// The current write index on a data stream cannot be shrunk. In order to shrink the current write index, the data stream must first be rolled over so that a new write index is created and then the previous write index can be shrunk. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/EmbeddingRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/EmbeddingRequest.Converters.g.cs new file mode 100644 index 00000000000..dba9356a841 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/EmbeddingRequest.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class EmbeddingRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Inference.EmbeddingRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Inference.EmbeddingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Embedding = reader.ReadValue(options, null) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.EmbeddingRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Embedding, null); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/EmbeddingRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/EmbeddingRequest.g.cs new file mode 100644 index 00000000000..4529ac26983 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/EmbeddingRequest.g.cs @@ -0,0 +1,209 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the 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.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +public sealed partial class EmbeddingRequestParameters : Elastic.Transport.RequestParameters +{ + /// + /// + /// Specifies the amount of time to wait for the inference request to complete. + /// + /// + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// +/// Perform dense embedding inference on the service. +/// +/// +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.EmbeddingRequestConverter))] +public sealed partial class EmbeddingRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest +{ + [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public EmbeddingRequest(Elastic.Clients.Elasticsearch.Id inferenceId) : base(r => r.Required("inference_id", inferenceId)) + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public EmbeddingRequest(Elastic.Clients.Elasticsearch.Id inferenceId, Elastic.Clients.Elasticsearch.Inference.RequestEmbedding embedding) : base(r => r.Required("inference_id", inferenceId)) + { + Embedding = embedding; + } + + public EmbeddingRequest() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal EmbeddingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + internal override Elastic.Clients.Elasticsearch.Requests.ApiUrls ApiUrls => Elastic.Clients.Elasticsearch.Requests.ApiUrlLookup.InferenceEmbedding; + + protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "inference.embedding"; + + /// + /// + /// The inference Id + /// + /// + public required Elastic.Clients.Elasticsearch.Id InferenceId { get => P("inference_id"); set => PR("inference_id", value); } + + /// + /// + /// Specifies the amount of time to wait for the inference request to complete. + /// + /// + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + public required Elastic.Clients.Elasticsearch.Inference.RequestEmbedding Embedding { get; set; } +} + +/// +/// +/// Perform dense embedding inference on the service. +/// +/// +public readonly partial struct EmbeddingRequestDescriptor +{ + internal Elastic.Clients.Elasticsearch.Inference.EmbeddingRequest Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public EmbeddingRequestDescriptor(Elastic.Clients.Elasticsearch.Inference.EmbeddingRequest instance) + { + Instance = instance; + } + + public EmbeddingRequestDescriptor(Elastic.Clients.Elasticsearch.Id inferenceId) + { +#pragma warning disable CS0618 + Instance = new Elastic.Clients.Elasticsearch.Inference.EmbeddingRequest(inferenceId); +#pragma warning restore CS0618 + } + + [System.Obsolete("The use of the parameterless constructor is not permitted for this type.")] + public EmbeddingRequestDescriptor() + { + throw new System.InvalidOperationException("The use of the parameterless constructor is not permitted for this type."); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Inference.EmbeddingRequestDescriptor(Elastic.Clients.Elasticsearch.Inference.EmbeddingRequest instance) => new Elastic.Clients.Elasticsearch.Inference.EmbeddingRequestDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Inference.EmbeddingRequest(Elastic.Clients.Elasticsearch.Inference.EmbeddingRequestDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// The inference Id + /// + /// + public Elastic.Clients.Elasticsearch.Inference.EmbeddingRequestDescriptor InferenceId(Elastic.Clients.Elasticsearch.Id value) + { + Instance.InferenceId = value; + return this; + } + + /// + /// + /// Specifies the amount of time to wait for the inference request to complete. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.EmbeddingRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? value) + { + Instance.Timeout = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Inference.EmbeddingRequestDescriptor Embedding(Elastic.Clients.Elasticsearch.Inference.RequestEmbedding value) + { + Instance.Embedding = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Inference.EmbeddingRequestDescriptor Embedding(System.Action action) + { + Instance.Embedding = Elastic.Clients.Elasticsearch.Inference.RequestEmbeddingDescriptor.Build(action); + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Inference.EmbeddingRequest Build(System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Inference.EmbeddingRequestDescriptor(new Elastic.Clients.Elasticsearch.Inference.EmbeddingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } + + public Elastic.Clients.Elasticsearch.Inference.EmbeddingRequestDescriptor ErrorTrace(bool? value) + { + Instance.ErrorTrace = value; + return this; + } + + [System.Diagnostics.CodeAnalysis.Experimental("ESEXP0001", UrlFormat = "https://www.elastic.co/docs/reference/elasticsearch/clients/dotnet/experimental#{0}" +#if NET10_0_OR_GREATER + , Message = "Use of response filtering can result in a response from Elasticsearch that cannot be correctly deserialized to the respective response type for the request." +#endif + )] + public Elastic.Clients.Elasticsearch.Inference.EmbeddingRequestDescriptor FilterPath(params string[]? value) + { + Instance.FilterPath = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Inference.EmbeddingRequestDescriptor Human(bool? value) + { + Instance.Human = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Inference.EmbeddingRequestDescriptor Pretty(bool? value) + { + Instance.Pretty = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Inference.EmbeddingRequestDescriptor SourceQueryString(string? value) + { + Instance.SourceQueryString = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Inference.EmbeddingRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) + { + Instance.RequestConfiguration = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Inference.EmbeddingRequestDescriptor RequestConfiguration(System.Func? configurationSelector) + { + Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; + return this; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/EmbeddingResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/EmbeddingResponse.Converters.g.cs new file mode 100644 index 00000000000..56386cfcc8f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/EmbeddingResponse.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class EmbeddingResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Inference.EmbeddingResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Inference.EmbeddingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { InferenceResult = reader.ReadValue(options, null) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.EmbeddingResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.InferenceResult, null); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/EmbeddingResponse.g.cs similarity index 78% rename from src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleResponse.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/EmbeddingResponse.g.cs index 18387eb0854..6c301d8bcc7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/EmbeddingResponse.g.cs @@ -21,21 +21,21 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.IndexManagement; +namespace Elastic.Clients.Elasticsearch.Inference; -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetSampleResponseConverter))] -public sealed partial class GetSampleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.EmbeddingResponseConverter))] +public sealed partial class EmbeddingResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public GetSampleResponse() + public EmbeddingResponse() { } [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - internal GetSampleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + internal EmbeddingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) { _ = sentinel; } - public required System.Collections.Generic.IReadOnlyCollection Sample { get; set; } + public required Elastic.Clients.Elasticsearch.Inference.EmbeddingInferenceResult InferenceResult { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetInferenceRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetInferenceRequest.g.cs index b9e69975657..74ae1e141a8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetInferenceRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetInferenceRequest.g.cs @@ -46,6 +46,10 @@ public GetInferenceRequest(Elastic.Clients.Elasticsearch.Inference.TaskType? tas { } + public GetInferenceRequest(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType) : base(r => r.Optional("task_type", taskType)) + { + } + public GetInferenceRequest() { } @@ -66,14 +70,15 @@ internal GetInferenceRequest(Elastic.Clients.Elasticsearch.Serialization.JsonCon /// /// - /// The inference Id + /// The inference Id of the endpoint to return. Using _all or * will return all endpoints with the specified + /// task_type if one is specified, or all endpoints for all task types if no task_type is specified /// /// public Elastic.Clients.Elasticsearch.Id? InferenceId { get => P("inference_id"); set => PO("inference_id", value); } /// /// - /// The task type + /// The task type of the endpoint to return /// /// public Elastic.Clients.Elasticsearch.Inference.TaskType? TaskType { get => P("task_type"); set => PO("task_type", value); } @@ -107,6 +112,11 @@ public GetInferenceRequestDescriptor(Elastic.Clients.Elasticsearch.Inference.Tas Instance = new Elastic.Clients.Elasticsearch.Inference.GetInferenceRequest(taskType, inferenceId); } + public GetInferenceRequestDescriptor(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType) + { + Instance = new Elastic.Clients.Elasticsearch.Inference.GetInferenceRequest(taskType); + } + public GetInferenceRequestDescriptor() { Instance = new Elastic.Clients.Elasticsearch.Inference.GetInferenceRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); @@ -117,7 +127,8 @@ public GetInferenceRequestDescriptor() /// /// - /// The inference Id + /// The inference Id of the endpoint to return. Using _all or * will return all endpoints with the specified + /// task_type if one is specified, or all endpoints for all task types if no task_type is specified /// /// public Elastic.Clients.Elasticsearch.Inference.GetInferenceRequestDescriptor InferenceId(Elastic.Clients.Elasticsearch.Id? value) @@ -128,7 +139,7 @@ public Elastic.Clients.Elasticsearch.Inference.GetInferenceRequestDescriptor Inf /// /// - /// The task type + /// The task type of the endpoint to return /// /// public Elastic.Clients.Elasticsearch.Inference.GetInferenceRequestDescriptor TaskType(Elastic.Clients.Elasticsearch.Inference.TaskType? value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/InferenceRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/InferenceRequest.g.cs index e9192448548..4a98f6be933 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/InferenceRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/InferenceRequest.g.cs @@ -130,7 +130,7 @@ internal InferenceRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstr /// /// - /// Specifies the input data type for the text embedding model. The input_type parameter only applies to Inference Endpoints with the text_embedding task type. Possible values include: + /// Specifies the input data type for the embedding model. The input_type parameter only applies to Inference Endpoints with the embedding or text_embedding task type. Possible values include: /// /// /// @@ -297,7 +297,7 @@ public Elastic.Clients.Elasticsearch.Inference.InferenceRequestDescriptor Input( /// /// - /// Specifies the input data type for the text embedding model. The input_type parameter only applies to Inference Endpoints with the text_embedding task type. Possible values include: + /// Specifies the input data type for the embedding model. The input_type parameter only applies to Inference Endpoints with the embedding or text_embedding task type. Possible values include: /// /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAi21Response.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAi21Response.g.cs index d3a96259972..2f7e6ce41db 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAi21Response.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAi21Response.g.cs @@ -40,7 +40,7 @@ internal PutAi21Response(Elastic.Clients.Elasticsearch.Serialization.JsonConstru /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudResponse.g.cs index 9d06ae7cae9..68855007f6e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudResponse.g.cs @@ -40,7 +40,7 @@ internal PutAlibabacloudResponse(Elastic.Clients.Elasticsearch.Serialization.Jso /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockRequest.g.cs index 91825a21dfe..5a0d718e9c0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockRequest.g.cs @@ -103,7 +103,7 @@ internal PutAmazonbedrockRequest(Elastic.Clients.Elasticsearch.Serialization.Jso /// /// The chunking configuration object. /// Applies only to the text_embedding task type. - /// Not applicable to the completion task type. + /// Not applicable to the chat_completion and completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } @@ -206,7 +206,7 @@ public Elastic.Clients.Elasticsearch.Inference.PutAmazonbedrockRequestDescriptor /// /// The chunking configuration object. /// Applies only to the text_embedding task type. - /// Not applicable to the completion task type. + /// Not applicable to the chat_completion and completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.PutAmazonbedrockRequestDescriptor ChunkingSettings(Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? value) @@ -219,7 +219,7 @@ public Elastic.Clients.Elasticsearch.Inference.PutAmazonbedrockRequestDescriptor /// /// The chunking configuration object. /// Applies only to the text_embedding task type. - /// Not applicable to the completion task type. + /// Not applicable to the chat_completion and completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.PutAmazonbedrockRequestDescriptor ChunkingSettings() @@ -232,7 +232,7 @@ public Elastic.Clients.Elasticsearch.Inference.PutAmazonbedrockRequestDescriptor /// /// The chunking configuration object. /// Applies only to the text_embedding task type. - /// Not applicable to the completion task type. + /// Not applicable to the chat_completion and completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.PutAmazonbedrockRequestDescriptor ChunkingSettings(System.Action? action) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockResponse.g.cs index f65a99fc618..f75de4da6b2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockResponse.g.cs @@ -40,7 +40,7 @@ internal PutAmazonbedrockResponse(Elastic.Clients.Elasticsearch.Serialization.Js /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonsagemakerResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonsagemakerResponse.g.cs index 1a0fa795427..2fa9498a879 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonsagemakerResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonsagemakerResponse.g.cs @@ -40,7 +40,7 @@ internal PutAmazonsagemakerResponse(Elastic.Clients.Elasticsearch.Serialization. /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAnthropicResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAnthropicResponse.g.cs index a93d16115f8..6656deee0e9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAnthropicResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAnthropicResponse.g.cs @@ -40,7 +40,7 @@ internal PutAnthropicResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCo /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureaistudioResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureaistudioResponse.g.cs index 2ef60018626..ab5dda1f69a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureaistudioResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureaistudioResponse.g.cs @@ -40,7 +40,7 @@ internal PutAzureaistudioResponse(Elastic.Clients.Elasticsearch.Serialization.Js /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureopenaiResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureopenaiResponse.g.cs index a7f698c8556..e997952e637 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureopenaiResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureopenaiResponse.g.cs @@ -40,7 +40,7 @@ internal PutAzureopenaiResponse(Elastic.Clients.Elasticsearch.Serialization.Json /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCohereResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCohereResponse.g.cs index e9c30e61c77..083702616b1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCohereResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCohereResponse.g.cs @@ -40,7 +40,7 @@ internal PutCohereResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutContextualaiResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutContextualaiResponse.g.cs index 2aac0c0366a..f1cb5c2b371 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutContextualaiResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutContextualaiResponse.g.cs @@ -40,7 +40,7 @@ internal PutContextualaiResponse(Elastic.Clients.Elasticsearch.Serialization.Jso /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCustomResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCustomResponse.g.cs index a765b3d799d..927c7ad5593 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCustomResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCustomResponse.g.cs @@ -40,7 +40,7 @@ internal PutCustomResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutDeepseekResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutDeepseekResponse.g.cs index d6c61edb7b8..651cb2cfffc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutDeepseekResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutDeepseekResponse.g.cs @@ -40,7 +40,7 @@ internal PutDeepseekResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCon /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElasticsearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElasticsearchResponse.g.cs index ef171a4c5fa..cfe1fc7a4eb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElasticsearchResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElasticsearchResponse.g.cs @@ -40,7 +40,7 @@ internal PutElasticsearchResponse(Elastic.Clients.Elasticsearch.Serialization.Js /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElserResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElserResponse.g.cs index 09be7a43d07..bac9e43eb10 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElserResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElserResponse.g.cs @@ -40,7 +40,7 @@ internal PutElserResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstr /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutFireworksaiRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutFireworksaiRequest.Converters.g.cs new file mode 100644 index 00000000000..c0f5b640ae7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutFireworksaiRequest.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutFireworksaiRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"u8); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"u8); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"u8); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"u8); + + public override Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropService)) + { + reader.SafeSkip(); + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutFireworksaiRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutFireworksaiRequest.g.cs new file mode 100644 index 00000000000..150c3e7e442 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutFireworksaiRequest.g.cs @@ -0,0 +1,356 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the 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.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +public sealed partial class PutFireworksaiRequestParameters : Elastic.Transport.RequestParameters +{ + /// + /// + /// Specifies the amount of time to wait for the inference endpoint to be created. + /// + /// + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// +/// Create a Fireworks AI inference endpoint. +/// +/// +/// Create an inference endpoint to perform an inference task with the fireworksai service. +/// +/// +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutFireworksaiRequestConverter))] +public sealed partial class PutFireworksaiRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest +{ + [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public PutFireworksaiRequest(Elastic.Clients.Elasticsearch.Inference.FireworksAITaskType taskType, Elastic.Clients.Elasticsearch.Id fireworksaiInferenceId) : base(r => r.Required("task_type", taskType).Required("fireworksai_inference_id", fireworksaiInferenceId)) + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public PutFireworksaiRequest(Elastic.Clients.Elasticsearch.Inference.FireworksAITaskType taskType, Elastic.Clients.Elasticsearch.Id fireworksaiInferenceId, Elastic.Clients.Elasticsearch.Inference.FireworksAIServiceSettings serviceSettings) : base(r => r.Required("task_type", taskType).Required("fireworksai_inference_id", fireworksaiInferenceId)) + { + ServiceSettings = serviceSettings; + } + + public PutFireworksaiRequest() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal PutFireworksaiRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + internal override Elastic.Clients.Elasticsearch.Requests.ApiUrls ApiUrls => Elastic.Clients.Elasticsearch.Requests.ApiUrlLookup.InferencePutFireworksai; + + protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "inference.put_fireworksai"; + + /// + /// + /// The unique identifier of the inference endpoint. + /// + /// + public required Elastic.Clients.Elasticsearch.Id FireworksaiInferenceId { get => P("fireworksai_inference_id"); set => PR("fireworksai_inference_id", value); } + + /// + /// + /// The type of the inference task that the model will perform. + /// + /// + public required Elastic.Clients.Elasticsearch.Inference.FireworksAITaskType TaskType { get => P("task_type"); set => PR("task_type", value); } + + /// + /// + /// Specifies the amount of time to wait for the inference endpoint to be created. + /// + /// + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// + /// The chunking configuration object. + /// Applies only to the text_embedding task type. + /// Not applicable to the completion or chat_completion task types. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } + + /// + /// + /// The type of service supported for the specified task type. In this case, fireworksai. + /// + /// + public string Service => "fireworksai"; + + /// + /// + /// Settings used to install the inference model. These settings are specific to the fireworksai service. + /// + /// + public required Elastic.Clients.Elasticsearch.Inference.FireworksAIServiceSettings ServiceSettings { get; set; } + + /// + /// + /// Settings to configure the inference task. + /// Applies only to the completion or chat_completion task types. + /// Not applicable to the text_embedding task type. + /// These settings are specific to the task type you specified. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.FireworksAITaskSettings? TaskSettings { get; set; } +} + +/// +/// +/// Create a Fireworks AI inference endpoint. +/// +/// +/// Create an inference endpoint to perform an inference task with the fireworksai service. +/// +/// +public readonly partial struct PutFireworksaiRequestDescriptor +{ + internal Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequest Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public PutFireworksaiRequestDescriptor(Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequest instance) + { + Instance = instance; + } + + public PutFireworksaiRequestDescriptor(Elastic.Clients.Elasticsearch.Inference.FireworksAITaskType taskType, Elastic.Clients.Elasticsearch.Id fireworksaiInferenceId) + { +#pragma warning disable CS0618 + Instance = new Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequest(taskType, fireworksaiInferenceId); +#pragma warning restore CS0618 + } + + [System.Obsolete("The use of the parameterless constructor is not permitted for this type.")] + public PutFireworksaiRequestDescriptor() + { + throw new System.InvalidOperationException("The use of the parameterless constructor is not permitted for this type."); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequestDescriptor(Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequest instance) => new Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequestDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequest(Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequestDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// The unique identifier of the inference endpoint. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequestDescriptor FireworksaiInferenceId(Elastic.Clients.Elasticsearch.Id value) + { + Instance.FireworksaiInferenceId = value; + return this; + } + + /// + /// + /// The type of the inference task that the model will perform. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequestDescriptor TaskType(Elastic.Clients.Elasticsearch.Inference.FireworksAITaskType value) + { + Instance.TaskType = value; + return this; + } + + /// + /// + /// Specifies the amount of time to wait for the inference endpoint to be created. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? value) + { + Instance.Timeout = value; + return this; + } + + /// + /// + /// The chunking configuration object. + /// Applies only to the text_embedding task type. + /// Not applicable to the completion or chat_completion task types. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequestDescriptor ChunkingSettings(Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? value) + { + Instance.ChunkingSettings = value; + return this; + } + + /// + /// + /// The chunking configuration object. + /// Applies only to the text_embedding task type. + /// Not applicable to the completion or chat_completion task types. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequestDescriptor ChunkingSettings() + { + Instance.ChunkingSettings = Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettingsDescriptor.Build(null); + return this; + } + + /// + /// + /// The chunking configuration object. + /// Applies only to the text_embedding task type. + /// Not applicable to the completion or chat_completion task types. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequestDescriptor ChunkingSettings(System.Action? action) + { + Instance.ChunkingSettings = Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettingsDescriptor.Build(action); + return this; + } + + /// + /// + /// Settings used to install the inference model. These settings are specific to the fireworksai service. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequestDescriptor ServiceSettings(Elastic.Clients.Elasticsearch.Inference.FireworksAIServiceSettings value) + { + Instance.ServiceSettings = value; + return this; + } + + /// + /// + /// Settings used to install the inference model. These settings are specific to the fireworksai service. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequestDescriptor ServiceSettings(System.Action action) + { + Instance.ServiceSettings = Elastic.Clients.Elasticsearch.Inference.FireworksAiServiceSettingsDescriptor.Build(action); + return this; + } + + /// + /// + /// Settings to configure the inference task. + /// Applies only to the completion or chat_completion task types. + /// Not applicable to the text_embedding task type. + /// These settings are specific to the task type you specified. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequestDescriptor TaskSettings(Elastic.Clients.Elasticsearch.Inference.FireworksAITaskSettings? value) + { + Instance.TaskSettings = value; + return this; + } + + /// + /// + /// Settings to configure the inference task. + /// Applies only to the completion or chat_completion task types. + /// Not applicable to the text_embedding task type. + /// These settings are specific to the task type you specified. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequestDescriptor TaskSettings() + { + Instance.TaskSettings = Elastic.Clients.Elasticsearch.Inference.FireworksAiTaskSettingsDescriptor.Build(null); + return this; + } + + /// + /// + /// Settings to configure the inference task. + /// Applies only to the completion or chat_completion task types. + /// Not applicable to the text_embedding task type. + /// These settings are specific to the task type you specified. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequestDescriptor TaskSettings(System.Action? action) + { + Instance.TaskSettings = Elastic.Clients.Elasticsearch.Inference.FireworksAiTaskSettingsDescriptor.Build(action); + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequest Build(System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequestDescriptor(new Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } + + public Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequestDescriptor ErrorTrace(bool? value) + { + Instance.ErrorTrace = value; + return this; + } + + [System.Diagnostics.CodeAnalysis.Experimental("ESEXP0001", UrlFormat = "https://www.elastic.co/docs/reference/elasticsearch/clients/dotnet/experimental#{0}" +#if NET10_0_OR_GREATER + , Message = "Use of response filtering can result in a response from Elasticsearch that cannot be correctly deserialized to the respective response type for the request." +#endif + )] + public Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequestDescriptor FilterPath(params string[]? value) + { + Instance.FilterPath = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequestDescriptor Human(bool? value) + { + Instance.Human = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequestDescriptor Pretty(bool? value) + { + Instance.Pretty = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequestDescriptor SourceQueryString(string? value) + { + Instance.SourceQueryString = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) + { + Instance.RequestConfiguration = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequestDescriptor RequestConfiguration(System.Func? configurationSelector) + { + Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; + return this; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutFireworksaiResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutFireworksaiResponse.Converters.g.cs new file mode 100644 index 00000000000..d37f1aefc27 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutFireworksaiResponse.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutFireworksaiResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"u8); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"u8); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"u8); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"u8); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"u8); + private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"u8); + + public override Elastic.Clients.Elasticsearch.Inference.PutFireworksaiResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + LocalJsonValue propTaskType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutFireworksaiResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + InferenceId = propInferenceId.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value, + TaskType = propTaskType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutFireworksaiResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutFireworksaiResponse.g.cs similarity index 52% rename from src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsResponse.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutFireworksaiResponse.g.cs index 2b9bb7d5095..a85886db40d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutFireworksaiResponse.g.cs @@ -21,34 +21,63 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.IndexManagement; +namespace Elastic.Clients.Elasticsearch.Inference; -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetSampleStatsResponseConverter))] -public sealed partial class GetSampleStatsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutFireworksaiResponseConverter))] +public sealed partial class PutFireworksaiResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public GetSampleStatsResponse() + public PutFireworksaiResponse() { } [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - internal GetSampleStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + internal PutFireworksaiResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) { _ = sentinel; } - public string? LastException { get; set; } - public required long PotentialSamples { get; set; } - public required long SamplesAccepted { get; set; } - public required long SamplesRejectedForCondition { get; set; } - public required long SamplesRejectedForException { get; set; } - public required long SamplesRejectedForMaxSamplesExceeded { get; set; } - public required long SamplesRejectedForRate { get; set; } - public required long SamplesRejectedForSize { get; set; } - public Elastic.Clients.Elasticsearch.Duration? TimeCompilingCondition { get; set; } - public required System.TimeSpan TimeCompilingConditionMillis { get; set; } - public Elastic.Clients.Elasticsearch.Duration? TimeEvaluatingCondition { get; set; } - public required System.TimeSpan TimeEvaluatingConditionMillis { get; set; } - public Elastic.Clients.Elasticsearch.Duration? TimeSampling { get; set; } - public required System.TimeSpan TimeSamplingMillis { get; set; } + /// + /// + /// The chunking configuration object. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } + + /// + /// + /// The inference Id + /// + /// + public required string InferenceId { get; set; } + + /// + /// + /// The service type + /// + /// + public required string Service { get; set; } + + /// + /// + /// Settings specific to the service + /// + /// + public required object ServiceSettings { get; set; } + + /// + /// + /// Task settings specific to the service and task type + /// + /// + public object? TaskSettings { get; set; } + + /// + /// + /// The task type + /// + /// + public required Elastic.Clients.Elasticsearch.Inference.TaskTypeFireworksAI TaskType { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGoogleaistudioResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGoogleaistudioResponse.g.cs index d0d56bda65e..751419fc124 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGoogleaistudioResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGoogleaistudioResponse.g.cs @@ -40,7 +40,7 @@ internal PutGoogleaistudioResponse(Elastic.Clients.Elasticsearch.Serialization.J /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGooglevertexaiResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGooglevertexaiResponse.g.cs index 6077ffba821..04ec14c82dc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGooglevertexaiResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGooglevertexaiResponse.g.cs @@ -40,7 +40,7 @@ internal PutGooglevertexaiResponse(Elastic.Clients.Elasticsearch.Serialization.J /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGroqResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGroqResponse.g.cs index f9c2541369f..7229120236b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGroqResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGroqResponse.g.cs @@ -40,7 +40,7 @@ internal PutGroqResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstru /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutHuggingFaceResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutHuggingFaceResponse.g.cs index 42e4c066e38..5b0e4909287 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutHuggingFaceResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutHuggingFaceResponse.g.cs @@ -40,7 +40,7 @@ internal PutHuggingFaceResponse(Elastic.Clients.Elasticsearch.Serialization.Json /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceRequest.g.cs index 875f44fffd0..baf35c709e2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceRequest.g.cs @@ -58,7 +58,7 @@ public sealed partial class PutInferenceRequestParameters : Elastic.Transport.Re /// /// /// -/// Amazon Bedrock (completion, text_embedding) +/// Amazon Bedrock (chat_completion, completion, text_embedding) /// /// /// @@ -103,6 +103,11 @@ public sealed partial class PutInferenceRequestParameters : Elastic.Transport.Re /// /// /// +/// Fireworks AI (chat_completion, completion, text_embedding) +/// +/// +/// +/// /// Google AI Studio (completion, text_embedding) /// /// @@ -123,7 +128,7 @@ public sealed partial class PutInferenceRequestParameters : Elastic.Transport.Re /// /// /// -/// JinaAI (rerank, text_embedding) +/// JinaAI (embedding, rerank, text_embedding) /// /// /// @@ -158,7 +163,7 @@ public sealed partial class PutInferenceRequestParameters : Elastic.Transport.Re /// /// /// -/// Watsonx inference integration (text_embedding) +/// Watsonx (chat_completion, completion, rerank, text_embedding) /// /// /// @@ -256,7 +261,7 @@ internal PutInferenceRequest(Elastic.Clients.Elasticsearch.Serialization.JsonCon /// /// /// -/// Amazon Bedrock (completion, text_embedding) +/// Amazon Bedrock (chat_completion, completion, text_embedding) /// /// /// @@ -301,6 +306,11 @@ internal PutInferenceRequest(Elastic.Clients.Elasticsearch.Serialization.JsonCon /// /// /// +/// Fireworks AI (chat_completion, completion, text_embedding) +/// +/// +/// +/// /// Google AI Studio (completion, text_embedding) /// /// @@ -321,7 +331,7 @@ internal PutInferenceRequest(Elastic.Clients.Elasticsearch.Serialization.JsonCon /// /// /// -/// JinaAI (rerank, text_embedding) +/// JinaAI (embedding, rerank, text_embedding) /// /// /// @@ -356,7 +366,7 @@ internal PutInferenceRequest(Elastic.Clients.Elasticsearch.Serialization.JsonCon /// /// /// -/// Watsonx inference integration (text_embedding) +/// Watsonx (chat_completion, completion, rerank, text_embedding) /// /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceResponse.g.cs index e07c7d838d0..d5805cae0b3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceResponse.g.cs @@ -40,7 +40,7 @@ internal PutInferenceResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCo /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiRequest.g.cs index d975e8a8ce9..012ee06f6e8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiRequest.g.cs @@ -42,7 +42,7 @@ public sealed partial class PutJinaaiRequestParameters : Elastic.Transport.Reque /// /// /// To review the available rerank models, refer to https://jina.ai/reranker. -/// To review the available text_embedding models, refer to the https://jina.ai/embeddings/. +/// To review the available embedding and text_embedding models, refer to https://jina.ai/embeddings/. /// /// [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutJinaaiRequestConverter))] @@ -102,8 +102,7 @@ internal PutJinaaiRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstr /// /// /// The chunking configuration object. - /// Applies only to the text_embedding task type. - /// Not applicable to the rerank task type. + /// Applies only to the embedding and text_embeddingtask types. Not applicable to thererank` task type. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } @@ -140,7 +139,7 @@ internal PutJinaaiRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstr /// /// /// To review the available rerank models, refer to https://jina.ai/reranker. -/// To review the available text_embedding models, refer to the https://jina.ai/embeddings/. +/// To review the available embedding and text_embedding models, refer to https://jina.ai/embeddings/. /// /// public readonly partial struct PutJinaaiRequestDescriptor @@ -205,8 +204,7 @@ public Elastic.Clients.Elasticsearch.Inference.PutJinaaiRequestDescriptor Timeou /// /// /// The chunking configuration object. - /// Applies only to the text_embedding task type. - /// Not applicable to the rerank task type. + /// Applies only to the embedding and text_embeddingtask types. Not applicable to thererank` task type. /// /// public Elastic.Clients.Elasticsearch.Inference.PutJinaaiRequestDescriptor ChunkingSettings(Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? value) @@ -218,8 +216,7 @@ public Elastic.Clients.Elasticsearch.Inference.PutJinaaiRequestDescriptor Chunki /// /// /// The chunking configuration object. - /// Applies only to the text_embedding task type. - /// Not applicable to the rerank task type. + /// Applies only to the embedding and text_embeddingtask types. Not applicable to thererank` task type. /// /// public Elastic.Clients.Elasticsearch.Inference.PutJinaaiRequestDescriptor ChunkingSettings() @@ -231,8 +228,7 @@ public Elastic.Clients.Elasticsearch.Inference.PutJinaaiRequestDescriptor Chunki /// /// /// The chunking configuration object. - /// Applies only to the text_embedding task type. - /// Not applicable to the rerank task type. + /// Applies only to the embedding and text_embeddingtask types. Not applicable to thererank` task type. /// /// public Elastic.Clients.Elasticsearch.Inference.PutJinaaiRequestDescriptor ChunkingSettings(System.Action? action) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiResponse.g.cs index 725929a3cb5..e59c897dfe7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiResponse.g.cs @@ -40,7 +40,7 @@ internal PutJinaaiResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutLlamaResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutLlamaResponse.g.cs index 52f2d4b440f..c6a9d77ab7c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutLlamaResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutLlamaResponse.g.cs @@ -40,7 +40,7 @@ internal PutLlamaResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstr /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutMistralResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutMistralResponse.g.cs index 83ef30d5b5f..9abc36d8aa5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutMistralResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutMistralResponse.g.cs @@ -40,7 +40,7 @@ internal PutMistralResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCons /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutNvidiaResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutNvidiaResponse.g.cs index f76212a7cd0..a58fa20e829 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutNvidiaResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutNvidiaResponse.g.cs @@ -40,7 +40,7 @@ internal PutNvidiaResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenaiResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenaiResponse.g.cs index 2be138aebbd..74ae96337df 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenaiResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenaiResponse.g.cs @@ -40,7 +40,7 @@ internal PutOpenaiResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenshiftAiResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenshiftAiResponse.g.cs index 667b82b401c..d368d449c13 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenshiftAiResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenshiftAiResponse.g.cs @@ -40,7 +40,7 @@ internal PutOpenshiftAiResponse(Elastic.Clients.Elasticsearch.Serialization.Json /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutVoyageaiResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutVoyageaiResponse.g.cs index b5059779524..e819a263547 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutVoyageaiResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutVoyageaiResponse.g.cs @@ -40,7 +40,7 @@ internal PutVoyageaiResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCon /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxRequest.g.cs index d8fccfc7787..17674fa8134 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxRequest.g.cs @@ -101,7 +101,7 @@ internal PutWatsonxRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// /// The chunking configuration object. /// Applies only to the text_embedding task type. - /// Not applicable to the completion or chat_completion task types. + /// Not applicable to the rerank, completion or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } @@ -194,7 +194,7 @@ public Elastic.Clients.Elasticsearch.Inference.PutWatsonxRequestDescriptor Timeo /// /// The chunking configuration object. /// Applies only to the text_embedding task type. - /// Not applicable to the completion or chat_completion task types. + /// Not applicable to the rerank, completion or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.PutWatsonxRequestDescriptor ChunkingSettings(Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? value) @@ -207,7 +207,7 @@ public Elastic.Clients.Elasticsearch.Inference.PutWatsonxRequestDescriptor Chunk /// /// The chunking configuration object. /// Applies only to the text_embedding task type. - /// Not applicable to the completion or chat_completion task types. + /// Not applicable to the rerank, completion or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.PutWatsonxRequestDescriptor ChunkingSettings() @@ -220,7 +220,7 @@ public Elastic.Clients.Elasticsearch.Inference.PutWatsonxRequestDescriptor Chunk /// /// The chunking configuration object. /// Applies only to the text_embedding task type. - /// Not applicable to the completion or chat_completion task types. + /// Not applicable to the rerank, completion or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.PutWatsonxRequestDescriptor ChunkingSettings(System.Action? action) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxResponse.g.cs index 3058a8458c6..8355761005b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxResponse.g.cs @@ -40,7 +40,7 @@ internal PutWatsonxResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCons /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/UpdateInferenceResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/UpdateInferenceResponse.g.cs index 223bd7ce45a..f90e25f816a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/UpdateInferenceResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/UpdateInferenceResponse.g.cs @@ -40,7 +40,7 @@ internal UpdateInferenceResponse(Elastic.Clients.Elasticsearch.Serialization.Jso /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedRequest.Converters.g.cs index 4b05fb222f0..22276380132 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedRequest.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedRequest.Converters.g.cs @@ -26,6 +26,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; public sealed partial class StopDatafeedRequestConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropAllowNoMatch = System.Text.Json.JsonEncodedText.Encode("allow_no_match"u8); + private static readonly System.Text.Json.JsonEncodedText PropCloseJob = System.Text.Json.JsonEncodedText.Encode("close_job"u8); private static readonly System.Text.Json.JsonEncodedText PropForce = System.Text.Json.JsonEncodedText.Encode("force"u8); private static readonly System.Text.Json.JsonEncodedText PropTimeout = System.Text.Json.JsonEncodedText.Encode("timeout"u8); @@ -33,6 +34,7 @@ public override Elastic.Clients.Elasticsearch.MachineLearning.StopDatafeedReques { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propAllowNoMatch = default; + LocalJsonValue propCloseJob = default; LocalJsonValue propForce = default; LocalJsonValue propTimeout = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) @@ -42,6 +44,11 @@ public override Elastic.Clients.Elasticsearch.MachineLearning.StopDatafeedReques continue; } + if (propCloseJob.TryReadProperty(ref reader, options, PropCloseJob, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + if (propForce.TryReadProperty(ref reader, options, PropForce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) { continue; @@ -65,6 +72,7 @@ public override Elastic.Clients.Elasticsearch.MachineLearning.StopDatafeedReques return new Elastic.Clients.Elasticsearch.MachineLearning.StopDatafeedRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { AllowNoMatch = propAllowNoMatch.Value, + CloseJob = propCloseJob.Value, Force = propForce.Value, Timeout = propTimeout.Value }; @@ -74,6 +82,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropAllowNoMatch, value.AllowNoMatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCloseJob, value.CloseJob, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropForce, value.Force, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropTimeout, value.Timeout, null, null); writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedRequest.g.cs index d9ecdb05474..05fd0371dd7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedRequest.g.cs @@ -78,6 +78,13 @@ internal StopDatafeedRequest(Elastic.Clients.Elasticsearch.Serialization.JsonCon /// public bool? AllowNoMatch { get; set; } + /// + /// + /// Refer to the description for the close_job query parameter. + /// + /// + public bool? CloseJob { get; set; } + /// /// /// Refer to the description for the force query parameter. @@ -150,6 +157,17 @@ public Elastic.Clients.Elasticsearch.MachineLearning.StopDatafeedRequestDescript return this; } + /// + /// + /// Refer to the description for the close_job query parameter. + /// + /// + public Elastic.Clients.Elasticsearch.MachineLearning.StopDatafeedRequestDescriptor CloseJob(bool? value = true) + { + Instance.CloseJob = value; + return this; + } + /// /// /// Refer to the description for the force query parameter. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/CreateManyRoutingRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/CreateManyRoutingRequest.Converters.g.cs new file mode 100644 index 00000000000..1b849164ce8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/CreateManyRoutingRequest.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Project.Json; + +public sealed partial class CreateManyRoutingRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Expressions = reader.ReadValue>(options, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Expressions, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/CreateManyRoutingRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/CreateManyRoutingRequest.g.cs new file mode 100644 index 00000000000..a1d0d1b0c36 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/CreateManyRoutingRequest.g.cs @@ -0,0 +1,174 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Project; + +public sealed partial class CreateManyRoutingRequestParameters : Elastic.Transport.RequestParameters +{ +} + +/// +/// +/// Create or update project routing expressions. +/// +/// +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Project.Json.CreateManyRoutingRequestConverter))] +public sealed partial class CreateManyRoutingRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CreateManyRoutingRequest(System.Collections.Generic.IDictionary expressions) + { + Expressions = expressions; + } + + public CreateManyRoutingRequest() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal CreateManyRoutingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + internal override Elastic.Clients.Elasticsearch.Requests.ApiUrls ApiUrls => Elastic.Clients.Elasticsearch.Requests.ApiUrlLookup.ProjectCreateManyRouting; + + protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "project.create_many_routing"; + + public required System.Collections.Generic.IDictionary Expressions { get; set; } +} + +/// +/// +/// Create or update project routing expressions. +/// +/// +public readonly partial struct CreateManyRoutingRequestDescriptor +{ + internal Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequest Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CreateManyRoutingRequestDescriptor(Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequest instance) + { + Instance = instance; + } + + public CreateManyRoutingRequestDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequestDescriptor(Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequest instance) => new Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequestDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequest(Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequestDescriptor descriptor) => descriptor.Instance; + + public Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequestDescriptor Expressions(System.Collections.Generic.IDictionary value) + { + Instance.Expressions = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequestDescriptor Expressions() + { + Instance.Expressions = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringProjectRoutingExpression.Build(null); + return this; + } + + public Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequestDescriptor Expressions(System.Action? action) + { + Instance.Expressions = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringProjectRoutingExpression.Build(action); + return this; + } + + public Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequestDescriptor AddExpression(string key, Elastic.Clients.Elasticsearch.Project.ProjectRoutingExpression value) + { + Instance.Expressions ??= new System.Collections.Generic.Dictionary(); + Instance.Expressions.Add(key, value); + return this; + } + + public Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequestDescriptor AddExpression(string key, System.Action action) + { + Instance.Expressions ??= new System.Collections.Generic.Dictionary(); + Instance.Expressions.Add(key, Elastic.Clients.Elasticsearch.Project.ProjectRoutingExpressionDescriptor.Build(action)); + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequest Build(System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequestDescriptor(new Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } + + public Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequestDescriptor ErrorTrace(bool? value) + { + Instance.ErrorTrace = value; + return this; + } + + [System.Diagnostics.CodeAnalysis.Experimental("ESEXP0001", UrlFormat = "https://www.elastic.co/docs/reference/elasticsearch/clients/dotnet/experimental#{0}" +#if NET10_0_OR_GREATER +, Message = "Use of response filtering can result in a response from Elasticsearch that cannot be correctly deserialized to the respective response type for the request." +#endif +)] + public Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequestDescriptor FilterPath(params string[]? value) + { + Instance.FilterPath = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequestDescriptor Human(bool? value) + { + Instance.Human = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequestDescriptor Pretty(bool? value) + { + Instance.Pretty = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequestDescriptor SourceQueryString(string? value) + { + Instance.SourceQueryString = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) + { + Instance.RequestConfiguration = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequestDescriptor RequestConfiguration(System.Func? configurationSelector) + { + Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; + return this; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/CreateManyRoutingResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/CreateManyRoutingResponse.Converters.g.cs new file mode 100644 index 00000000000..5cefccfeb79 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/CreateManyRoutingResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Project.Json; + +public sealed partial class CreateManyRoutingResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"u8); + + public override Elastic.Clients.Elasticsearch.Project.CreateManyRoutingResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Project.CreateManyRoutingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Project.CreateManyRoutingResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/CreateManyRoutingResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/CreateManyRoutingResponse.g.cs new file mode 100644 index 00000000000..7d009b83900 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/CreateManyRoutingResponse.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Project; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Project.Json.CreateManyRoutingResponseConverter))] +public sealed partial class CreateManyRoutingResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CreateManyRoutingResponse() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal CreateManyRoutingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// For a successful response, this value is always true. On failure, an exception is returned instead. + /// + /// + public required bool Acknowledged { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/CreateRoutingRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/CreateRoutingRequest.Converters.g.cs new file mode 100644 index 00000000000..51c6e4ca647 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/CreateRoutingRequest.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Project.Json; + +public sealed partial class CreateRoutingRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Project.CreateRoutingRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Project.CreateRoutingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Expressions = reader.ReadValue(options, null) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Project.CreateRoutingRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Expressions, null); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/CreateRoutingRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/CreateRoutingRequest.g.cs new file mode 100644 index 00000000000..32fd91077e1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/CreateRoutingRequest.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Project; + +public sealed partial class CreateRoutingRequestParameters : Elastic.Transport.RequestParameters +{ +} + +/// +/// +/// Create or update a project routing expression. +/// +/// +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Project.Json.CreateRoutingRequestConverter))] +public sealed partial class CreateRoutingRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest +{ + [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CreateRoutingRequest(string name) : base(r => r.Required("name", name)) + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CreateRoutingRequest(string name, Elastic.Clients.Elasticsearch.Project.ProjectRoutingExpression expressions) : base(r => r.Required("name", name)) + { + Expressions = expressions; + } + + public CreateRoutingRequest() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal CreateRoutingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + internal override Elastic.Clients.Elasticsearch.Requests.ApiUrls ApiUrls => Elastic.Clients.Elasticsearch.Requests.ApiUrlLookup.ProjectCreateRouting; + + protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "project.create_routing"; + + /// + /// + /// The name of project routing expression + /// + /// + public required string Name { get => P("name"); set => PR("name", value); } + public required Elastic.Clients.Elasticsearch.Project.ProjectRoutingExpression Expressions { get; set; } +} + +/// +/// +/// Create or update a project routing expression. +/// +/// +public readonly partial struct CreateRoutingRequestDescriptor +{ + internal Elastic.Clients.Elasticsearch.Project.CreateRoutingRequest Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CreateRoutingRequestDescriptor(Elastic.Clients.Elasticsearch.Project.CreateRoutingRequest instance) + { + Instance = instance; + } + + public CreateRoutingRequestDescriptor(string name) + { +#pragma warning disable CS0618 + Instance = new Elastic.Clients.Elasticsearch.Project.CreateRoutingRequest(name); +#pragma warning restore CS0618 + } + + [System.Obsolete("The use of the parameterless constructor is not permitted for this type.")] + public CreateRoutingRequestDescriptor() + { + throw new System.InvalidOperationException("The use of the parameterless constructor is not permitted for this type."); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Project.CreateRoutingRequestDescriptor(Elastic.Clients.Elasticsearch.Project.CreateRoutingRequest instance) => new Elastic.Clients.Elasticsearch.Project.CreateRoutingRequestDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Project.CreateRoutingRequest(Elastic.Clients.Elasticsearch.Project.CreateRoutingRequestDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// The name of project routing expression + /// + /// + public Elastic.Clients.Elasticsearch.Project.CreateRoutingRequestDescriptor Name(string value) + { + Instance.Name = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.CreateRoutingRequestDescriptor Expressions(Elastic.Clients.Elasticsearch.Project.ProjectRoutingExpression value) + { + Instance.Expressions = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.CreateRoutingRequestDescriptor Expressions(System.Action action) + { + Instance.Expressions = Elastic.Clients.Elasticsearch.Project.ProjectRoutingExpressionDescriptor.Build(action); + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Project.CreateRoutingRequest Build(System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Project.CreateRoutingRequestDescriptor(new Elastic.Clients.Elasticsearch.Project.CreateRoutingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } + + public Elastic.Clients.Elasticsearch.Project.CreateRoutingRequestDescriptor ErrorTrace(bool? value) + { + Instance.ErrorTrace = value; + return this; + } + + [System.Diagnostics.CodeAnalysis.Experimental("ESEXP0001", UrlFormat = "https://www.elastic.co/docs/reference/elasticsearch/clients/dotnet/experimental#{0}" +#if NET10_0_OR_GREATER + , Message = "Use of response filtering can result in a response from Elasticsearch that cannot be correctly deserialized to the respective response type for the request." +#endif + )] + public Elastic.Clients.Elasticsearch.Project.CreateRoutingRequestDescriptor FilterPath(params string[]? value) + { + Instance.FilterPath = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.CreateRoutingRequestDescriptor Human(bool? value) + { + Instance.Human = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.CreateRoutingRequestDescriptor Pretty(bool? value) + { + Instance.Pretty = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.CreateRoutingRequestDescriptor SourceQueryString(string? value) + { + Instance.SourceQueryString = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.CreateRoutingRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) + { + Instance.RequestConfiguration = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.CreateRoutingRequestDescriptor RequestConfiguration(System.Func? configurationSelector) + { + Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; + return this; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/CreateRoutingResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/CreateRoutingResponse.Converters.g.cs new file mode 100644 index 00000000000..bdec8129248 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/CreateRoutingResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Project.Json; + +public sealed partial class CreateRoutingResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"u8); + + public override Elastic.Clients.Elasticsearch.Project.CreateRoutingResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Project.CreateRoutingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Project.CreateRoutingResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleConfigurationResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/CreateRoutingResponse.g.cs similarity index 71% rename from src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleConfigurationResponse.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/CreateRoutingResponse.g.cs index a6f0507e0f0..be01d677af0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleConfigurationResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/CreateRoutingResponse.g.cs @@ -21,22 +21,26 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.IndexManagement; +namespace Elastic.Clients.Elasticsearch.Project; -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetSampleConfigurationResponseConverter))] -public sealed partial class GetSampleConfigurationResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Project.Json.CreateRoutingResponseConverter))] +public sealed partial class CreateRoutingResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public GetSampleConfigurationResponse() + public CreateRoutingResponse() { } [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - internal GetSampleConfigurationResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + internal CreateRoutingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) { _ = sentinel; } - public required Elastic.Clients.Elasticsearch.IndexManagement.SamplingConfiguration? Configuration { get; set; } - public required string Index { get; set; } + /// + /// + /// For a successful response, this value is always true. On failure, an exception is returned instead. + /// + /// + public required bool Acknowledged { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAllSampleConfigurationRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/DeleteRoutingRequest.Converters.g.cs similarity index 70% rename from src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAllSampleConfigurationRequest.Converters.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/DeleteRoutingRequest.Converters.g.cs index 566c49c8986..53cf8e24d22 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAllSampleConfigurationRequest.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/DeleteRoutingRequest.Converters.g.cs @@ -21,11 +21,11 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; +namespace Elastic.Clients.Elasticsearch.Project.Json; -public sealed partial class GetAllSampleConfigurationRequestConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class DeleteRoutingRequestConverter : System.Text.Json.Serialization.JsonConverter { - public override Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + public override Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) @@ -40,12 +40,12 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfig } reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + return new Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { }; } - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequest value, System.Text.Json.JsonSerializerOptions options) + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequest value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/DeleteRoutingRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/DeleteRoutingRequest.g.cs new file mode 100644 index 00000000000..5dd48bd5522 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/DeleteRoutingRequest.g.cs @@ -0,0 +1,163 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Project; + +public sealed partial class DeleteRoutingRequestParameters : Elastic.Transport.RequestParameters +{ +} + +/// +/// +/// Delete a project routing expression. +/// +/// +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Project.Json.DeleteRoutingRequestConverter))] +public sealed partial class DeleteRoutingRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public DeleteRoutingRequest(string name) : base(r => r.Required("name", name)) + { + } + + public DeleteRoutingRequest() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal DeleteRoutingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + internal override Elastic.Clients.Elasticsearch.Requests.ApiUrls ApiUrls => Elastic.Clients.Elasticsearch.Requests.ApiUrlLookup.ProjectDeleteRouting; + + protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "project.delete_routing"; + + /// + /// + /// The name of project routing expression + /// + /// + public required string Name { get => P("name"); set => PR("name", value); } +} + +/// +/// +/// Delete a project routing expression. +/// +/// +public readonly partial struct DeleteRoutingRequestDescriptor +{ + internal Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequest Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public DeleteRoutingRequestDescriptor(Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequest instance) + { + Instance = instance; + } + + public DeleteRoutingRequestDescriptor(string name) + { + Instance = new Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequest(name); + } + + [System.Obsolete("The use of the parameterless constructor is not permitted for this type.")] + public DeleteRoutingRequestDescriptor() + { + throw new System.InvalidOperationException("The use of the parameterless constructor is not permitted for this type."); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequestDescriptor(Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequest instance) => new Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequestDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequest(Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequestDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// The name of project routing expression + /// + /// + public Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequestDescriptor Name(string value) + { + Instance.Name = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequest Build(System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequestDescriptor(new Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } + + public Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequestDescriptor ErrorTrace(bool? value) + { + Instance.ErrorTrace = value; + return this; + } + + [System.Diagnostics.CodeAnalysis.Experimental("ESEXP0001", UrlFormat = "https://www.elastic.co/docs/reference/elasticsearch/clients/dotnet/experimental#{0}" +#if NET10_0_OR_GREATER + , Message = "Use of response filtering can result in a response from Elasticsearch that cannot be correctly deserialized to the respective response type for the request." +#endif + )] + public Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequestDescriptor FilterPath(params string[]? value) + { + Instance.FilterPath = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequestDescriptor Human(bool? value) + { + Instance.Human = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequestDescriptor Pretty(bool? value) + { + Instance.Pretty = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequestDescriptor SourceQueryString(string? value) + { + Instance.SourceQueryString = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) + { + Instance.RequestConfiguration = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequestDescriptor RequestConfiguration(System.Func? configurationSelector) + { + Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; + return this; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/DeleteRoutingResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/DeleteRoutingResponse.Converters.g.cs new file mode 100644 index 00000000000..dcc9cfe5d36 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/DeleteRoutingResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Project.Json; + +public sealed partial class DeleteRoutingResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"u8); + + public override Elastic.Clients.Elasticsearch.Project.DeleteRoutingResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Project.DeleteRoutingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Project.DeleteRoutingResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/DeleteRoutingResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/DeleteRoutingResponse.g.cs new file mode 100644 index 00000000000..856d9696019 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/DeleteRoutingResponse.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Project; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Project.Json.DeleteRoutingResponseConverter))] +public sealed partial class DeleteRoutingResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public DeleteRoutingResponse() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal DeleteRoutingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// For a successful response, this value is always true. On failure, an exception is returned instead. + /// + /// + public required bool Acknowledged { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/GetManyRoutingRequest.Converters.g.cs similarity index 74% rename from src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsRequest.Converters.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/GetManyRoutingRequest.Converters.g.cs index 43e31a3dc47..b6d9220e8c6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsRequest.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/GetManyRoutingRequest.Converters.g.cs @@ -21,11 +21,11 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; +namespace Elastic.Clients.Elasticsearch.Project.Json; -public sealed partial class GetSampleStatsRequestConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class GetManyRoutingRequestConverter : System.Text.Json.Serialization.JsonConverter { - public override Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + public override Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) @@ -40,12 +40,12 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequ } reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + return new Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { }; } - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest value, System.Text.Json.JsonSerializerOptions options) + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequest value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/GetManyRoutingRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/GetManyRoutingRequest.g.cs new file mode 100644 index 00000000000..233e796e79d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/GetManyRoutingRequest.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Project; + +public sealed partial class GetManyRoutingRequestParameters : Elastic.Transport.RequestParameters +{ +} + +/// +/// +/// Get project routing expressions. +/// +/// +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Project.Json.GetManyRoutingRequestConverter))] +public sealed partial class GetManyRoutingRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest +{ + public GetManyRoutingRequest() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal GetManyRoutingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + internal override Elastic.Clients.Elasticsearch.Requests.ApiUrls ApiUrls => Elastic.Clients.Elasticsearch.Requests.ApiUrlLookup.ProjectGetManyRouting; + + protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "project.get_many_routing"; +} + +/// +/// +/// Get project routing expressions. +/// +/// +public readonly partial struct GetManyRoutingRequestDescriptor +{ + internal Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequest Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public GetManyRoutingRequestDescriptor(Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequest instance) + { + Instance = instance; + } + + public GetManyRoutingRequestDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequestDescriptor(Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequest instance) => new Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequestDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequest(Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequestDescriptor descriptor) => descriptor.Instance; + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequest Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequestDescriptor(new Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } + + public Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequestDescriptor ErrorTrace(bool? value) + { + Instance.ErrorTrace = value; + return this; + } + + [System.Diagnostics.CodeAnalysis.Experimental("ESEXP0001", UrlFormat = "https://www.elastic.co/docs/reference/elasticsearch/clients/dotnet/experimental#{0}" +#if NET10_0_OR_GREATER +, Message = "Use of response filtering can result in a response from Elasticsearch that cannot be correctly deserialized to the respective response type for the request." +#endif +)] + public Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequestDescriptor FilterPath(params string[]? value) + { + Instance.FilterPath = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequestDescriptor Human(bool? value) + { + Instance.Human = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequestDescriptor Pretty(bool? value) + { + Instance.Pretty = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequestDescriptor SourceQueryString(string? value) + { + Instance.SourceQueryString = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) + { + Instance.RequestConfiguration = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequestDescriptor RequestConfiguration(System.Func? configurationSelector) + { + Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; + return this; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/GetManyRoutingResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/GetManyRoutingResponse.Converters.g.cs new file mode 100644 index 00000000000..f4b9437ab38 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/GetManyRoutingResponse.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Project.Json; + +public sealed partial class GetManyRoutingResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Project.GetManyRoutingResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Project.GetManyRoutingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Result = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Project.GetManyRoutingResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Result, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/GetManyRoutingResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/GetManyRoutingResponse.g.cs new file mode 100644 index 00000000000..1ca6dcfe3c0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/GetManyRoutingResponse.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Project; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Project.Json.GetManyRoutingResponseConverter))] +public sealed partial class GetManyRoutingResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public GetManyRoutingResponse() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal GetManyRoutingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public required System.Collections.Generic.IReadOnlyDictionary Result { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/GetRoutingRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/GetRoutingRequest.Converters.g.cs new file mode 100644 index 00000000000..79f644c3569 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/GetRoutingRequest.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Project.Json; + +public sealed partial class GetRoutingRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Project.GetRoutingRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Project.GetRoutingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Project.GetRoutingRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/GetRoutingRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/GetRoutingRequest.g.cs new file mode 100644 index 00000000000..ee170f3a2bf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/GetRoutingRequest.g.cs @@ -0,0 +1,163 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Project; + +public sealed partial class GetRoutingRequestParameters : Elastic.Transport.RequestParameters +{ +} + +/// +/// +/// Get a project routing expression. +/// +/// +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Project.Json.GetRoutingRequestConverter))] +public sealed partial class GetRoutingRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public GetRoutingRequest(string name) : base(r => r.Required("name", name)) + { + } + + public GetRoutingRequest() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal GetRoutingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + internal override Elastic.Clients.Elasticsearch.Requests.ApiUrls ApiUrls => Elastic.Clients.Elasticsearch.Requests.ApiUrlLookup.ProjectGetRouting; + + protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "project.get_routing"; + + /// + /// + /// The name of project routing expression + /// + /// + public required string Name { get => P("name"); set => PR("name", value); } +} + +/// +/// +/// Get a project routing expression. +/// +/// +public readonly partial struct GetRoutingRequestDescriptor +{ + internal Elastic.Clients.Elasticsearch.Project.GetRoutingRequest Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public GetRoutingRequestDescriptor(Elastic.Clients.Elasticsearch.Project.GetRoutingRequest instance) + { + Instance = instance; + } + + public GetRoutingRequestDescriptor(string name) + { + Instance = new Elastic.Clients.Elasticsearch.Project.GetRoutingRequest(name); + } + + [System.Obsolete("The use of the parameterless constructor is not permitted for this type.")] + public GetRoutingRequestDescriptor() + { + throw new System.InvalidOperationException("The use of the parameterless constructor is not permitted for this type."); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Project.GetRoutingRequestDescriptor(Elastic.Clients.Elasticsearch.Project.GetRoutingRequest instance) => new Elastic.Clients.Elasticsearch.Project.GetRoutingRequestDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Project.GetRoutingRequest(Elastic.Clients.Elasticsearch.Project.GetRoutingRequestDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// The name of project routing expression + /// + /// + public Elastic.Clients.Elasticsearch.Project.GetRoutingRequestDescriptor Name(string value) + { + Instance.Name = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Project.GetRoutingRequest Build(System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Project.GetRoutingRequestDescriptor(new Elastic.Clients.Elasticsearch.Project.GetRoutingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } + + public Elastic.Clients.Elasticsearch.Project.GetRoutingRequestDescriptor ErrorTrace(bool? value) + { + Instance.ErrorTrace = value; + return this; + } + + [System.Diagnostics.CodeAnalysis.Experimental("ESEXP0001", UrlFormat = "https://www.elastic.co/docs/reference/elasticsearch/clients/dotnet/experimental#{0}" +#if NET10_0_OR_GREATER + , Message = "Use of response filtering can result in a response from Elasticsearch that cannot be correctly deserialized to the respective response type for the request." +#endif + )] + public Elastic.Clients.Elasticsearch.Project.GetRoutingRequestDescriptor FilterPath(params string[]? value) + { + Instance.FilterPath = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.GetRoutingRequestDescriptor Human(bool? value) + { + Instance.Human = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.GetRoutingRequestDescriptor Pretty(bool? value) + { + Instance.Pretty = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.GetRoutingRequestDescriptor SourceQueryString(string? value) + { + Instance.SourceQueryString = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.GetRoutingRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) + { + Instance.RequestConfiguration = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Project.GetRoutingRequestDescriptor RequestConfiguration(System.Func? configurationSelector) + { + Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; + return this; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/GetRoutingResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/GetRoutingResponse.Converters.g.cs new file mode 100644 index 00000000000..0de020afbc5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/GetRoutingResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Project.Json; + +public sealed partial class GetRoutingResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExpression = System.Text.Json.JsonEncodedText.Encode("expression"u8); + + public override Elastic.Clients.Elasticsearch.Project.GetRoutingResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExpression = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExpression.TryReadProperty(ref reader, options, PropExpression, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Project.GetRoutingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Expression = propExpression.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Project.GetRoutingResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExpression, value.Expression, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/GetRoutingResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/GetRoutingResponse.g.cs new file mode 100644 index 00000000000..52fbaf073bd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/GetRoutingResponse.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Project; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Project.Json.GetRoutingResponseConverter))] +public sealed partial class GetRoutingResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public GetRoutingResponse() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal GetRoutingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public required string Expression { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/TagsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/TagsRequest.Converters.g.cs index 7fe21141180..f8439a32aa2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/TagsRequest.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/TagsRequest.Converters.g.cs @@ -25,11 +25,19 @@ namespace Elastic.Clients.Elasticsearch.Project.Json; public sealed partial class TagsRequestConverter : System.Text.Json.Serialization.JsonConverter { + private static readonly System.Text.Json.JsonEncodedText PropProjectRouting = System.Text.Json.JsonEncodedText.Encode("project_routing"u8); + public override Elastic.Clients.Elasticsearch.Project.TagsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propProjectRouting = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { + if (propProjectRouting.TryReadProperty(ref reader, options, PropProjectRouting, null)) + { + continue; + } + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) { reader.SafeSkip(); @@ -42,12 +50,14 @@ public override Elastic.Clients.Elasticsearch.Project.TagsRequest Read(ref Syste reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); return new Elastic.Clients.Elasticsearch.Project.TagsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { + ProjectRouting = propProjectRouting.Value }; } public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Project.TagsRequest value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); + writer.WriteProperty(options, PropProjectRouting, value.ProjectRouting, null, null); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/TagsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/TagsRequest.g.cs index 12a34675926..92d6692d337 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/TagsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/TagsRequest.g.cs @@ -25,12 +25,6 @@ namespace Elastic.Clients.Elasticsearch.Project; public sealed partial class TagsRequestParameters : Elastic.Transport.RequestParameters { - /// - /// - /// A Lucene query using project metadata tags used to filter which projects are returned in the response, such as _alias:_origin or _alias:pr. - /// - /// - public string? ProjectRouting { get => Q("project_routing"); set => Q("project_routing", value); } } /// @@ -58,16 +52,21 @@ internal TagsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructor protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.POST; - internal override bool SupportsBody => false; + internal override bool SupportsBody => true; internal override string OperationName => "project.tags"; /// /// - /// A Lucene query using project metadata tags used to filter which projects are returned in the response, such as _alias:_origin or _alias:pr. + /// A Lucene query using project metadata tags used to filter which projects are returned in the response. + /// Examples: + /// _alias:my-project + /// _alias:_origin + /// _alias:pr + /// Supported in serverless only. /// /// - public string? ProjectRouting { get => Q("project_routing"); set => Q("project_routing", value); } + public string? ProjectRouting { get; set; } } /// @@ -98,7 +97,12 @@ public TagsRequestDescriptor() /// /// - /// A Lucene query using project metadata tags used to filter which projects are returned in the response, such as _alias:_origin or _alias:pr. + /// A Lucene query using project metadata tags used to filter which projects are returned in the response. + /// Examples: + /// _alias:my-project + /// _alias:_origin + /// _alias:pr + /// Supported in serverless only. /// /// public Elastic.Clients.Elasticsearch.Project.TagsRequestDescriptor ProjectRouting(string? value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexResponse.Converters.g.cs index 58d95c30a7f..ab91e2bc414 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexResponse.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexResponse.Converters.g.cs @@ -33,6 +33,7 @@ public sealed partial class ReindexResponseConverter : System.Text.Json.Serializ private static readonly System.Text.Json.JsonEncodedText PropRequestsPerSecond = System.Text.Json.JsonEncodedText.Encode("requests_per_second"u8); private static readonly System.Text.Json.JsonEncodedText PropRetries = System.Text.Json.JsonEncodedText.Encode("retries"u8); private static readonly System.Text.Json.JsonEncodedText PropSliceId = System.Text.Json.JsonEncodedText.Encode("slice_id"u8); + private static readonly System.Text.Json.JsonEncodedText PropSlices = System.Text.Json.JsonEncodedText.Encode("slices"u8); private static readonly System.Text.Json.JsonEncodedText PropTask = System.Text.Json.JsonEncodedText.Encode("task"u8); private static readonly System.Text.Json.JsonEncodedText PropThrottledMillis = System.Text.Json.JsonEncodedText.Encode("throttled_millis"u8); private static readonly System.Text.Json.JsonEncodedText PropThrottledUntilMillis = System.Text.Json.JsonEncodedText.Encode("throttled_until_millis"u8); @@ -53,6 +54,7 @@ public override Elastic.Clients.Elasticsearch.ReindexResponse Read(ref System.Te LocalJsonValue propRequestsPerSecond = default; LocalJsonValue propRetries = default; LocalJsonValue propSliceId = default; + LocalJsonValue?> propSlices = default; LocalJsonValue propTask = default; LocalJsonValue propThrottledMillis = default; LocalJsonValue propThrottledUntilMillis = default; @@ -103,6 +105,11 @@ public override Elastic.Clients.Elasticsearch.ReindexResponse Read(ref System.Te continue; } + if (propSlices.TryReadProperty(ref reader, options, PropSlices, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + if (propTask.TryReadProperty(ref reader, options, PropTask, null)) { continue; @@ -163,6 +170,7 @@ public override Elastic.Clients.Elasticsearch.ReindexResponse Read(ref System.Te RequestsPerSecond = propRequestsPerSecond.Value, Retries = propRetries.Value, SliceId = propSliceId.Value, + Slices = propSlices.Value, Task = propTask.Value, ThrottledMillis = propThrottledMillis.Value, ThrottledUntilMillis = propThrottledUntilMillis.Value, @@ -185,6 +193,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropRequestsPerSecond, value.RequestsPerSecond, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropRetries, value.Retries, null, null); writer.WriteProperty(options, PropSliceId, value.SliceId, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSlices, value.Slices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); writer.WriteProperty(options, PropTask, value.Task, null, null); writer.WriteProperty(options, PropThrottledMillis, value.ThrottledMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); writer.WriteProperty(options, PropThrottledUntilMillis, value.ThrottledUntilMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexResponse.g.cs index cbbb6fc9135..899e7dc0268 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexResponse.g.cs @@ -89,6 +89,13 @@ internal ReindexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstru /// public Elastic.Clients.Elasticsearch.Retries? Retries { get; set; } public int? SliceId { get; set; } + + /// + /// + /// Status of each slice if the reindex was sliced + /// + /// + public System.Collections.Generic.IReadOnlyCollection? Slices { get; set; } public Elastic.Clients.Elasticsearch.TaskId? Task { get; set; } /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleRequest.g.cs index a266d92385c..fc5b2f29236 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleRequest.g.cs @@ -25,6 +25,8 @@ namespace Elastic.Clients.Elasticsearch; public sealed partial class ReindexRethrottleRequestParameters : Elastic.Transport.RequestParameters { + public Elastic.Clients.Elasticsearch.Tasks.GroupBy? GroupBy { get => Q("group_by"); set => Q("group_by", value); } + /// /// /// The throttle for this request in sub-requests per second. @@ -83,6 +85,7 @@ internal ReindexRethrottleRequest(Elastic.Clients.Elasticsearch.Serialization.Js /// /// public required Elastic.Clients.Elasticsearch.Id TaskId { get => P("task_id"); set => PR("task_id", value); } + public Elastic.Clients.Elasticsearch.Tasks.GroupBy? GroupBy { get => Q("group_by"); set => Q("group_by", value); } /// /// @@ -145,6 +148,12 @@ public Elastic.Clients.Elasticsearch.ReindexRethrottleRequestDescriptor TaskId(E return this; } + public Elastic.Clients.Elasticsearch.ReindexRethrottleRequestDescriptor GroupBy(Elastic.Clients.Elasticsearch.Tasks.GroupBy? value) + { + Instance.GroupBy = value; + return this; + } + /// /// /// The throttle for this request in sub-requests per second. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleResponse.Converters.g.cs index 26280f0c1e2..ddc374a2671 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleResponse.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleResponse.Converters.g.cs @@ -25,15 +25,36 @@ namespace Elastic.Clients.Elasticsearch.Json; public sealed partial class ReindexRethrottleResponseConverter : System.Text.Json.Serialization.JsonConverter { + private static readonly System.Text.Json.JsonEncodedText PropNodeFailures = System.Text.Json.JsonEncodedText.Encode("node_failures"u8); private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"u8); + private static readonly System.Text.Json.JsonEncodedText PropTaskFailures = System.Text.Json.JsonEncodedText.Encode("task_failures"u8); + private static readonly System.Text.Json.JsonEncodedText PropTasks = System.Text.Json.JsonEncodedText.Encode("tasks"u8); public override Elastic.Clients.Elasticsearch.ReindexRethrottleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propNodes = default; + LocalJsonValue?> propNodeFailures = default; + LocalJsonValue?> propNodes = default; + LocalJsonValue?> propTaskFailures = default; + LocalJsonValue, System.Collections.Generic.IReadOnlyDictionary>?> propTasks = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { - if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + if (propNodeFailures.TryReadProperty(ref reader, options, PropNodeFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propTaskFailures.TryReadProperty(ref reader, options, PropTaskFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTasks.TryReadProperty(ref reader, options, PropTasks, static Elastic.Clients.Elasticsearch.Union, System.Collections.Generic.IReadOnlyDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue, System.Collections.Generic.IReadOnlyDictionary>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject), static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!))) { continue; } @@ -50,14 +71,20 @@ public override Elastic.Clients.Elasticsearch.ReindexRethrottleResponse Read(ref reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); return new Elastic.Clients.Elasticsearch.ReindexRethrottleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { - Nodes = propNodes.Value + NodeFailures = propNodeFailures.Value, + Nodes = propNodes.Value, + TaskFailures = propTaskFailures.Value, + Tasks = propTasks.Value }; } public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ReindexRethrottleResponse value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); - writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNodeFailures, value.NodeFailures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropTaskFailures, value.TaskFailures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTasks, value.Tasks, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union, System.Collections.Generic.IReadOnlyDictionary>? v) => w.WriteUnionValue, System.Collections.Generic.IReadOnlyDictionary>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null))); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleResponse.g.cs index 8a4c4aab2f5..334b057d3ae 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleResponse.g.cs @@ -37,5 +37,8 @@ internal ReindexRethrottleResponse(Elastic.Clients.Elasticsearch.Serialization.J _ = sentinel; } - public required System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } + public System.Collections.Generic.IReadOnlyCollection? NodeFailures { get; set; } + public System.Collections.Generic.IReadOnlyDictionary? Nodes { get; set; } + public System.Collections.Generic.IReadOnlyCollection? TaskFailures { get; set; } + public Elastic.Clients.Elasticsearch.Union, System.Collections.Generic.IReadOnlyDictionary>? Tasks { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchMvtRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchMvtRequest.Converters.g.cs index 559668164ff..d828f949602 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchMvtRequest.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchMvtRequest.Converters.g.cs @@ -33,6 +33,7 @@ public sealed partial class SearchMvtRequestConverter : System.Text.Json.Seriali private static readonly System.Text.Json.JsonEncodedText PropGridAgg = System.Text.Json.JsonEncodedText.Encode("grid_agg"u8); private static readonly System.Text.Json.JsonEncodedText PropGridPrecision = System.Text.Json.JsonEncodedText.Encode("grid_precision"u8); private static readonly System.Text.Json.JsonEncodedText PropGridType = System.Text.Json.JsonEncodedText.Encode("grid_type"u8); + private static readonly System.Text.Json.JsonEncodedText PropProjectRouting = System.Text.Json.JsonEncodedText.Encode("project_routing"u8); private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"u8); private static readonly System.Text.Json.JsonEncodedText PropRuntimeMappings = System.Text.Json.JsonEncodedText.Encode("runtime_mappings"u8); private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"u8); @@ -51,6 +52,7 @@ public override Elastic.Clients.Elasticsearch.SearchMvtRequest Read(ref System.T LocalJsonValue propGridAgg = default; LocalJsonValue propGridPrecision = default; LocalJsonValue propGridType = default; + LocalJsonValue propProjectRouting = default; LocalJsonValue propQuery = default; LocalJsonValue?> propRuntimeMappings = default; LocalJsonValue propSize = default; @@ -99,6 +101,11 @@ public override Elastic.Clients.Elasticsearch.SearchMvtRequest Read(ref System.T continue; } + if (propProjectRouting.TryReadProperty(ref reader, options, PropProjectRouting, null)) + { + continue; + } + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) { continue; @@ -149,6 +156,7 @@ public override Elastic.Clients.Elasticsearch.SearchMvtRequest Read(ref System.T GridAgg = propGridAgg.Value, GridPrecision = propGridPrecision.Value, GridType = propGridType.Value, + ProjectRouting = propProjectRouting.Value, Query = propQuery.Value, RuntimeMappings = propRuntimeMappings.Value, Size = propSize.Value, @@ -169,6 +177,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropGridAgg, value.GridAgg, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropGridPrecision, value.GridPrecision, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropGridType, value.GridType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.SearchMvt.GridType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProjectRouting, value.ProjectRouting, null, null); writer.WriteProperty(options, PropQuery, value.Query, null, null); writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchMvtRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchMvtRequest.g.cs index f4c664485c2..46bfa1359d5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchMvtRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchMvtRequest.g.cs @@ -25,19 +25,6 @@ namespace Elastic.Clients.Elasticsearch; public sealed partial class SearchMvtRequestParameters : Elastic.Transport.RequestParameters { - /// - /// - /// Specifies a subset of projects to target for the search using project - /// metadata tags in a subset of Lucene query syntax. - /// Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). - /// Examples: - /// _alias:my-project - /// _alias:_origin - /// _alias:pr - /// Supported in serverless only. - /// - /// - public string? ProjectRouting { get => Q("project_routing"); set => Q("project_routing", value); } } /// @@ -261,20 +248,6 @@ internal SearchMvtRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstr /// public required int Zoom { get => P("zoom"); set => PR("zoom", value); } - /// - /// - /// Specifies a subset of projects to target for the search using project - /// metadata tags in a subset of Lucene query syntax. - /// Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). - /// Examples: - /// _alias:my-project - /// _alias:_origin - /// _alias:pr - /// Supported in serverless only. - /// - /// - public string? ProjectRouting { get => Q("project_routing"); set => Q("project_routing", value); } - /// /// /// Sub-aggregations for the geotile_grid. @@ -411,6 +384,20 @@ internal SearchMvtRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstr /// public Elastic.Clients.Elasticsearch.Core.SearchMvt.GridType? GridType { get; set; } + /// + /// + /// Specifies a subset of projects to target for the search using project + /// metadata tags in a subset of Lucene query syntax. + /// Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + /// Examples: + /// _alias:my-project + /// _alias:_origin + /// _alias:pr + /// Supported in serverless only. + /// + /// + public string? ProjectRouting { get; set; } + /// /// /// The query DSL used to filter documents for the search. @@ -744,24 +731,6 @@ public Elastic.Clients.Elasticsearch.SearchMvtRequestDescriptor Zoom(int value) return this; } - /// - /// - /// Specifies a subset of projects to target for the search using project - /// metadata tags in a subset of Lucene query syntax. - /// Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). - /// Examples: - /// _alias:my-project - /// _alias:_origin - /// _alias:pr - /// Supported in serverless only. - /// - /// - public Elastic.Clients.Elasticsearch.SearchMvtRequestDescriptor ProjectRouting(string? value) - { - Instance.ProjectRouting = value; - return this; - } - /// /// /// Sub-aggregations for the geotile_grid. @@ -1202,6 +1171,24 @@ public Elastic.Clients.Elasticsearch.SearchMvtRequestDescriptor GridType(Elastic return this; } + /// + /// + /// Specifies a subset of projects to target for the search using project + /// metadata tags in a subset of Lucene query syntax. + /// Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + /// Examples: + /// _alias:my-project + /// _alias:_origin + /// _alias:pr + /// Supported in serverless only. + /// + /// + public Elastic.Clients.Elasticsearch.SearchMvtRequestDescriptor ProjectRouting(string? value) + { + Instance.ProjectRouting = value; + return this; + } + /// /// /// The query DSL used to filter documents for the search. @@ -1778,24 +1765,6 @@ public Elastic.Clients.Elasticsearch.SearchMvtRequestDescriptor Zoom( return this; } - /// - /// - /// Specifies a subset of projects to target for the search using project - /// metadata tags in a subset of Lucene query syntax. - /// Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). - /// Examples: - /// _alias:my-project - /// _alias:_origin - /// _alias:pr - /// Supported in serverless only. - /// - /// - public Elastic.Clients.Elasticsearch.SearchMvtRequestDescriptor ProjectRouting(string? value) - { - Instance.ProjectRouting = value; - return this; - } - /// /// /// Sub-aggregations for the geotile_grid. @@ -2150,6 +2119,24 @@ public Elastic.Clients.Elasticsearch.SearchMvtRequestDescriptor GridT return this; } + /// + /// + /// Specifies a subset of projects to target for the search using project + /// metadata tags in a subset of Lucene query syntax. + /// Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + /// Examples: + /// _alias:my-project + /// _alias:_origin + /// _alias:pr + /// Supported in serverless only. + /// + /// + public Elastic.Clients.Elasticsearch.SearchMvtRequestDescriptor ProjectRouting(string? value) + { + Instance.ProjectRouting = value; + return this; + } + /// /// /// The query DSL used to filter documents for the search. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs index 93239d9dfbe..3e985d3425e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs @@ -354,7 +354,6 @@ public sealed partial class SearchRequestParameters : Elastic.Transport.RequestP /// /// When paging through a large number of documents, it can be helpful to split the search into multiple slices to consume them independently with the slice and pit properties. /// By default the splitting is done first on the shards, then locally on each shard. -/// The local splitting partitions the shard into contiguous ranges based on Lucene document IDs. /// /// /// For instance if the number of shards is equal to 2 and you request 4 slices, the slices 0 and 2 are assigned to the first shard and the slices 1 and 3 are assigned to the second shard. @@ -362,7 +361,7 @@ public sealed partial class SearchRequestParameters : Elastic.Transport.RequestP /// /// IMPORTANT: The same point-in-time ID should be used for all slices. /// If different PIT IDs are used, slices can overlap and miss documents. -/// This situation can occur because the splitting criterion is based on Lucene document IDs, which are not stable across changes to the index. +/// This situation can occur because, by default, the splitting criterion is based on Lucene document IDs, which are not stable across changes to the index. /// /// [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.SearchRequestConverter))] @@ -1019,7 +1018,6 @@ internal SearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstruct /// /// When paging through a large number of documents, it can be helpful to split the search into multiple slices to consume them independently with the slice and pit properties. /// By default the splitting is done first on the shards, then locally on each shard. -/// The local splitting partitions the shard into contiguous ranges based on Lucene document IDs. /// /// /// For instance if the number of shards is equal to 2 and you request 4 slices, the slices 0 and 2 are assigned to the first shard and the slices 1 and 3 are assigned to the second shard. @@ -1027,7 +1025,7 @@ internal SearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstruct /// /// IMPORTANT: The same point-in-time ID should be used for all slices. /// If different PIT IDs are used, slices can overlap and miss documents. -/// This situation can occur because the splitting criterion is based on Lucene document IDs, which are not stable across changes to the index. +/// This situation can occur because, by default, the splitting criterion is based on Lucene document IDs, which are not stable across changes to the index. /// /// public readonly partial struct SearchRequestDescriptor @@ -2797,7 +2795,6 @@ public Elastic.Clients.Elasticsearch.SearchRequestDescriptor RequestConfiguratio /// /// When paging through a large number of documents, it can be helpful to split the search into multiple slices to consume them independently with the slice and pit properties. /// By default the splitting is done first on the shards, then locally on each shard. -/// The local splitting partitions the shard into contiguous ranges based on Lucene document IDs. /// /// /// For instance if the number of shards is equal to 2 and you request 4 slices, the slices 0 and 2 are assigned to the first shard and the slices 1 and 3 are assigned to the second shard. @@ -2805,7 +2802,7 @@ public Elastic.Clients.Elasticsearch.SearchRequestDescriptor RequestConfiguratio /// /// IMPORTANT: The same point-in-time ID should be used for all slices. /// If different PIT IDs are used, slices can overlap and miss documents. -/// This situation can occur because the splitting criterion is based on Lucene document IDs, which are not stable across changes to the index. +/// This situation can occur because, by default, the splitting criterion is based on Lucene document IDs, which are not stable across changes to the index. /// /// public readonly partial struct SearchRequestDescriptor diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateRequest.Converters.g.cs index 8ce8fce368f..70e7918037b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateRequest.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateRequest.Converters.g.cs @@ -29,6 +29,7 @@ public sealed partial class SearchTemplateRequestConverter : System.Text.Json.Se private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"u8); private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"u8); private static readonly System.Text.Json.JsonEncodedText PropProfile = System.Text.Json.JsonEncodedText.Encode("profile"u8); + private static readonly System.Text.Json.JsonEncodedText PropProjectRouting = System.Text.Json.JsonEncodedText.Encode("project_routing"u8); private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"u8); public override Elastic.Clients.Elasticsearch.SearchTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) @@ -38,6 +39,7 @@ public override Elastic.Clients.Elasticsearch.SearchTemplateRequest Read(ref Sys LocalJsonValue propId = default; LocalJsonValue?> propParams = default; LocalJsonValue propProfile = default; + LocalJsonValue propProjectRouting = default; LocalJsonValue propSource = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -61,6 +63,11 @@ public override Elastic.Clients.Elasticsearch.SearchTemplateRequest Read(ref Sys continue; } + if (propProjectRouting.TryReadProperty(ref reader, options, PropProjectRouting, null)) + { + continue; + } + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) { continue; @@ -82,6 +89,7 @@ public override Elastic.Clients.Elasticsearch.SearchTemplateRequest Read(ref Sys Id = propId.Value, Params = propParams.Value, Profile = propProfile.Value, + ProjectRouting = propProjectRouting.Value, Source = propSource.Value }; } @@ -93,6 +101,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropId, value.Id, null, null); writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); writer.WriteProperty(options, PropProfile, value.Profile, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProjectRouting, value.ProjectRouting, null, null); writer.WriteProperty(options, PropSource, value.Source, null, null); writer.WriteEndObject(); } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateRequest.g.cs index ac836f89d36..d1d1af2ee31 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateRequest.g.cs @@ -36,7 +36,7 @@ public sealed partial class SearchTemplateRequestParameters : Elastic.Transport. /// /// - /// If true, network round-trips are minimized for cross-cluster search requests. + /// Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution. /// /// public bool? CcsMinimizeRoundtrips { get => Q("ccs_minimize_roundtrips"); set => Q("ccs_minimize_roundtrips", value); } @@ -73,20 +73,6 @@ public sealed partial class SearchTemplateRequestParameters : Elastic.Transport. /// public string? Preference { get => Q("preference"); set => Q("preference", value); } - /// - /// - /// Specifies a subset of projects to target for the search using project - /// metadata tags in a subset of Lucene query syntax. - /// Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). - /// Examples: - /// _alias:my-project - /// _alias:_origin - /// _alias:pr - /// Supported in serverless only. - /// - /// - public string? ProjectRouting { get => Q("project_routing"); set => Q("project_routing", value); } - /// /// /// If true, hits.total is rendered as an integer in the response. @@ -174,7 +160,7 @@ internal SearchTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonC /// /// - /// If true, network round-trips are minimized for cross-cluster search requests. + /// Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution. /// /// public bool? CcsMinimizeRoundtrips { get => Q("ccs_minimize_roundtrips"); set => Q("ccs_minimize_roundtrips", value); } @@ -211,20 +197,6 @@ internal SearchTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonC /// public string? Preference { get => Q("preference"); set => Q("preference", value); } - /// - /// - /// Specifies a subset of projects to target for the search using project - /// metadata tags in a subset of Lucene query syntax. - /// Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). - /// Examples: - /// _alias:my-project - /// _alias:_origin - /// _alias:pr - /// Supported in serverless only. - /// - /// - public string? ProjectRouting { get => Q("project_routing"); set => Q("project_routing", value); } - /// /// /// If true, hits.total is rendered as an integer in the response. @@ -294,6 +266,20 @@ internal SearchTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonC /// public bool? Profile { get; set; } + /// + /// + /// Specifies a subset of projects to target for the search using project + /// metadata tags in a subset of Lucene query syntax. + /// Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + /// Examples: + /// _alias:my-project + /// _alias:_origin + /// _alias:pr + /// Supported in serverless only. + /// + /// + public string? ProjectRouting { get; set; } + /// /// /// An inline search template. Supports the same parameters as the search API's @@ -359,7 +345,7 @@ public Elastic.Clients.Elasticsearch.SearchTemplateRequestDescriptor AllowNoIndi /// /// - /// If true, network round-trips are minimized for cross-cluster search requests. + /// Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution. /// /// public Elastic.Clients.Elasticsearch.SearchTemplateRequestDescriptor CcsMinimizeRoundtrips(bool? value = true) @@ -429,24 +415,6 @@ public Elastic.Clients.Elasticsearch.SearchTemplateRequestDescriptor Preference( return this; } - /// - /// - /// Specifies a subset of projects to target for the search using project - /// metadata tags in a subset of Lucene query syntax. - /// Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). - /// Examples: - /// _alias:my-project - /// _alias:_origin - /// _alias:pr - /// Supported in serverless only. - /// - /// - public Elastic.Clients.Elasticsearch.SearchTemplateRequestDescriptor ProjectRouting(string? value) - { - Instance.ProjectRouting = value; - return this; - } - /// /// /// If true, hits.total is rendered as an integer in the response. @@ -585,6 +553,24 @@ public Elastic.Clients.Elasticsearch.SearchTemplateRequestDescriptor Profile(boo return this; } + /// + /// + /// Specifies a subset of projects to target for the search using project + /// metadata tags in a subset of Lucene query syntax. + /// Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + /// Examples: + /// _alias:my-project + /// _alias:_origin + /// _alias:pr + /// Supported in serverless only. + /// + /// + public Elastic.Clients.Elasticsearch.SearchTemplateRequestDescriptor ProjectRouting(string? value) + { + Instance.ProjectRouting = value; + return this; + } + /// /// /// An inline search template. Supports the same parameters as the search API's @@ -714,7 +700,7 @@ public Elastic.Clients.Elasticsearch.SearchTemplateRequestDescriptor /// /// - /// If true, network round-trips are minimized for cross-cluster search requests. + /// Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution. /// /// public Elastic.Clients.Elasticsearch.SearchTemplateRequestDescriptor CcsMinimizeRoundtrips(bool? value = true) @@ -784,24 +770,6 @@ public Elastic.Clients.Elasticsearch.SearchTemplateRequestDescriptor return this; } - /// - /// - /// Specifies a subset of projects to target for the search using project - /// metadata tags in a subset of Lucene query syntax. - /// Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). - /// Examples: - /// _alias:my-project - /// _alias:_origin - /// _alias:pr - /// Supported in serverless only. - /// - /// - public Elastic.Clients.Elasticsearch.SearchTemplateRequestDescriptor ProjectRouting(string? value) - { - Instance.ProjectRouting = value; - return this; - } - /// /// /// If true, hits.total is rendered as an integer in the response. @@ -940,6 +908,24 @@ public Elastic.Clients.Elasticsearch.SearchTemplateRequestDescriptor return this; } + /// + /// + /// Specifies a subset of projects to target for the search using project + /// metadata tags in a subset of Lucene query syntax. + /// Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + /// Examples: + /// _alias:my-project + /// _alias:_origin + /// _alias:pr + /// Supported in serverless only. + /// + /// + public Elastic.Clients.Elasticsearch.SearchTemplateRequestDescriptor ProjectRouting(string? value) + { + Instance.ProjectRouting = value; + return this; + } + /// /// /// An inline search template. Supports the same parameters as the search API's diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/CacheStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/CacheStatsRequest.g.cs index 3ce71074cde..f1ec168ef11 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/CacheStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/CacheStatsRequest.g.cs @@ -25,7 +25,6 @@ namespace Elastic.Clients.Elasticsearch.SearchableSnapshots; public sealed partial class CacheStatsRequestParameters : Elastic.Transport.RequestParameters { - public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } /// @@ -67,7 +66,6 @@ internal CacheStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// /// public Elastic.Clients.Elasticsearch.NodeIds? NodeId { get => P("node_id"); set => PO("node_id", value); } - public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } /// @@ -112,12 +110,6 @@ public Elastic.Clients.Elasticsearch.SearchableSnapshots.CacheStatsRequestDescri return this; } - public Elastic.Clients.Elasticsearch.SearchableSnapshots.CacheStatsRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? value) - { - Instance.MasterTimeout = value; - return this; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.SearchableSnapshots.CacheStatsRequest Build(System.Action? action) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/MountRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/MountRequest.g.cs index 6e0601e646a..2ac94b8d780 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/MountRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/MountRequest.g.cs @@ -37,9 +37,10 @@ public sealed partial class MountRequestParameters : Elastic.Transport.RequestPa /// /// /// The mount option for the searchable snapshot index. + /// For further information on mount options, refer to: Mount options /// /// - public string? Storage { get => Q("storage"); set => Q("storage", value); } + public Elastic.Clients.Elasticsearch.SearchableSnapshots.StorageOption? Storage { get => Q("storage"); set => Q("storage", value); } /// /// @@ -118,9 +119,10 @@ internal MountRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructo /// /// /// The mount option for the searchable snapshot index. + /// For further information on mount options, refer to: Mount options /// /// - public string? Storage { get => Q("storage"); set => Q("storage", value); } + public Elastic.Clients.Elasticsearch.SearchableSnapshots.StorageOption? Storage { get => Q("storage"); set => Q("storage", value); } /// /// @@ -233,9 +235,10 @@ public Elastic.Clients.Elasticsearch.SearchableSnapshots.MountRequestDescriptor /// /// /// The mount option for the searchable snapshot index. + /// For further information on mount options, refer to: Mount options /// /// - public Elastic.Clients.Elasticsearch.SearchableSnapshots.MountRequestDescriptor Storage(string? value) + public Elastic.Clients.Elasticsearch.SearchableSnapshots.MountRequestDescriptor Storage(Elastic.Clients.Elasticsearch.SearchableSnapshots.StorageOption? value) { Instance.Storage = value; return this; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetSnapshotRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetSnapshotRequest.g.cs index b81380bc866..fd1a185e3d1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetSnapshotRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetSnapshotRequest.g.cs @@ -97,7 +97,7 @@ public sealed partial class GetSnapshotRequestParameters : Elastic.Transport.Req /// /// /// The maximum number of snapshots to return. - /// The default is 0, which means to return all that match the request without limit. + /// The default is -1, which means to return all that match the request without limit. /// /// public int? Size { get => Q("size"); set => Q("size", value); } @@ -278,7 +278,7 @@ internal GetSnapshotRequest(Elastic.Clients.Elasticsearch.Serialization.JsonCons /// /// /// The maximum number of snapshots to return. - /// The default is 0, which means to return all that match the request without limit. + /// The default is -1, which means to return all that match the request without limit. /// /// public int? Size { get => Q("size"); set => Q("size", value); } @@ -501,7 +501,7 @@ public Elastic.Clients.Elasticsearch.Snapshot.GetSnapshotRequestDescriptor Order /// /// /// The maximum number of snapshots to return. - /// The default is 0, which means to return all that match the request without limit. + /// The default is -1, which means to return all that match the request without limit. /// /// public Elastic.Clients.Elasticsearch.Snapshot.GetSnapshotRequestDescriptor Size(int? value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Streams/LogsDisableRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Streams/LogsDisableRequest.g.cs index c9d1bb53603..445a8197ad3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Streams/LogsDisableRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Streams/LogsDisableRequest.g.cs @@ -44,15 +44,20 @@ public sealed partial class LogsDisableRequestParameters : Elastic.Transport.Req /// /// -/// Disable logs stream. +/// Disable a named stream. /// /// -/// Turn off the logs stream feature for this cluster. +/// Turn off the named stream feature for this cluster. /// /// [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Streams.Json.LogsDisableRequestConverter))] public sealed partial class LogsDisableRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public LogsDisableRequest(Elastic.Clients.Elasticsearch.Streams.StreamType name) : base(r => r.Required("name", name)) + { + } + public LogsDisableRequest() { } @@ -71,6 +76,13 @@ internal LogsDisableRequest(Elastic.Clients.Elasticsearch.Serialization.JsonCons internal override string OperationName => "streams.logs_disable"; + /// + /// + /// The stream type to disable. + /// + /// + public required Elastic.Clients.Elasticsearch.Streams.StreamType Name { get => P("name"); set => PR("name", value); } + /// /// /// The period to wait for a connection to the master node. @@ -90,10 +102,10 @@ internal LogsDisableRequest(Elastic.Clients.Elasticsearch.Serialization.JsonCons /// /// -/// Disable logs stream. +/// Disable a named stream. /// /// -/// Turn off the logs stream feature for this cluster. +/// Turn off the named stream feature for this cluster. /// /// public readonly partial struct LogsDisableRequestDescriptor @@ -106,14 +118,31 @@ public LogsDisableRequestDescriptor(Elastic.Clients.Elasticsearch.Streams.LogsDi Instance = instance; } + public LogsDisableRequestDescriptor(Elastic.Clients.Elasticsearch.Streams.StreamType name) + { + Instance = new Elastic.Clients.Elasticsearch.Streams.LogsDisableRequest(name); + } + + [System.Obsolete("The use of the parameterless constructor is not permitted for this type.")] public LogsDisableRequestDescriptor() { - Instance = new Elastic.Clients.Elasticsearch.Streams.LogsDisableRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + throw new System.InvalidOperationException("The use of the parameterless constructor is not permitted for this type."); } public static explicit operator Elastic.Clients.Elasticsearch.Streams.LogsDisableRequestDescriptor(Elastic.Clients.Elasticsearch.Streams.LogsDisableRequest instance) => new Elastic.Clients.Elasticsearch.Streams.LogsDisableRequestDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Streams.LogsDisableRequest(Elastic.Clients.Elasticsearch.Streams.LogsDisableRequestDescriptor descriptor) => descriptor.Instance; + /// + /// + /// The stream type to disable. + /// + /// + public Elastic.Clients.Elasticsearch.Streams.LogsDisableRequestDescriptor Name(Elastic.Clients.Elasticsearch.Streams.StreamType value) + { + Instance.Name = value; + return this; + } + /// /// /// The period to wait for a connection to the master node. @@ -139,13 +168,8 @@ public Elastic.Clients.Elasticsearch.Streams.LogsDisableRequestDescriptor Timeou } [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - internal static Elastic.Clients.Elasticsearch.Streams.LogsDisableRequest Build(System.Action? action) + internal static Elastic.Clients.Elasticsearch.Streams.LogsDisableRequest Build(System.Action action) { - if (action is null) - { - return new Elastic.Clients.Elasticsearch.Streams.LogsDisableRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); - } - var builder = new Elastic.Clients.Elasticsearch.Streams.LogsDisableRequestDescriptor(new Elastic.Clients.Elasticsearch.Streams.LogsDisableRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); action.Invoke(builder); return builder.Instance; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Streams/LogsEnableRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Streams/LogsEnableRequest.g.cs index 356f39cb326..585e2f5f009 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Streams/LogsEnableRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Streams/LogsEnableRequest.g.cs @@ -44,20 +44,26 @@ public sealed partial class LogsEnableRequestParameters : Elastic.Transport.Requ /// /// -/// Enable logs stream. +/// Enable a named stream. /// /// -/// Turn on the logs stream feature for this cluster. +/// Turn on the named stream feature for this cluster. /// /// -/// NOTE: To protect existing data, this feature can be turned on only if the -/// cluster does not have existing indices or data streams that match the pattern logs|logs.*. -/// If those indices or data streams exist, a 409 - Conflict response and error is returned. +/// NOTE: To protect existing data, this feature can be turned on only if the cluster does not have +/// existing indices or data streams that match the pattern <name>|<name>.* for the enabled stream +/// type name. If those indices or data streams exist, a 409 - Conflict response and error is +/// returned. /// /// [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Streams.Json.LogsEnableRequestConverter))] public sealed partial class LogsEnableRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public LogsEnableRequest(Elastic.Clients.Elasticsearch.Streams.StreamType name) : base(r => r.Required("name", name)) + { + } + public LogsEnableRequest() { } @@ -76,6 +82,13 @@ internal LogsEnableRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConst internal override string OperationName => "streams.logs_enable"; + /// + /// + /// The stream type to enable. + /// + /// + public required Elastic.Clients.Elasticsearch.Streams.StreamType Name { get => P("name"); set => PR("name", value); } + /// /// /// The period to wait for a connection to the master node. @@ -95,15 +108,16 @@ internal LogsEnableRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// /// -/// Enable logs stream. +/// Enable a named stream. /// /// -/// Turn on the logs stream feature for this cluster. +/// Turn on the named stream feature for this cluster. /// /// -/// NOTE: To protect existing data, this feature can be turned on only if the -/// cluster does not have existing indices or data streams that match the pattern logs|logs.*. -/// If those indices or data streams exist, a 409 - Conflict response and error is returned. +/// NOTE: To protect existing data, this feature can be turned on only if the cluster does not have +/// existing indices or data streams that match the pattern <name>|<name>.* for the enabled stream +/// type name. If those indices or data streams exist, a 409 - Conflict response and error is +/// returned. /// /// public readonly partial struct LogsEnableRequestDescriptor @@ -116,14 +130,31 @@ public LogsEnableRequestDescriptor(Elastic.Clients.Elasticsearch.Streams.LogsEna Instance = instance; } + public LogsEnableRequestDescriptor(Elastic.Clients.Elasticsearch.Streams.StreamType name) + { + Instance = new Elastic.Clients.Elasticsearch.Streams.LogsEnableRequest(name); + } + + [System.Obsolete("The use of the parameterless constructor is not permitted for this type.")] public LogsEnableRequestDescriptor() { - Instance = new Elastic.Clients.Elasticsearch.Streams.LogsEnableRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + throw new System.InvalidOperationException("The use of the parameterless constructor is not permitted for this type."); } public static explicit operator Elastic.Clients.Elasticsearch.Streams.LogsEnableRequestDescriptor(Elastic.Clients.Elasticsearch.Streams.LogsEnableRequest instance) => new Elastic.Clients.Elasticsearch.Streams.LogsEnableRequestDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Streams.LogsEnableRequest(Elastic.Clients.Elasticsearch.Streams.LogsEnableRequestDescriptor descriptor) => descriptor.Instance; + /// + /// + /// The stream type to enable. + /// + /// + public Elastic.Clients.Elasticsearch.Streams.LogsEnableRequestDescriptor Name(Elastic.Clients.Elasticsearch.Streams.StreamType value) + { + Instance.Name = value; + return this; + } + /// /// /// The period to wait for a connection to the master node. @@ -149,13 +180,8 @@ public Elastic.Clients.Elasticsearch.Streams.LogsEnableRequestDescriptor Timeout } [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - internal static Elastic.Clients.Elasticsearch.Streams.LogsEnableRequest Build(System.Action? action) + internal static Elastic.Clients.Elasticsearch.Streams.LogsEnableRequest Build(System.Action action) { - if (action is null) - { - return new Elastic.Clients.Elasticsearch.Streams.LogsEnableRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); - } - var builder = new Elastic.Clients.Elasticsearch.Streams.LogsEnableRequestDescriptor(new Elastic.Clients.Elasticsearch.Streams.LogsEnableRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); action.Invoke(builder); return builder.Instance; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Streams/StreamsStatusResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Streams/StreamsStatusResponse.Converters.g.cs index b9f36c155f8..140bdf80782 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Streams/StreamsStatusResponse.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Streams/StreamsStatusResponse.Converters.g.cs @@ -26,11 +26,15 @@ namespace Elastic.Clients.Elasticsearch.Streams.Json; public sealed partial class StreamsStatusResponseConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropLogs = System.Text.Json.JsonEncodedText.Encode("logs"u8); + private static readonly System.Text.Json.JsonEncodedText PropLogsEcs = System.Text.Json.JsonEncodedText.Encode("logs.ecs"u8); + private static readonly System.Text.Json.JsonEncodedText PropLogsOtel = System.Text.Json.JsonEncodedText.Encode("logs.otel"u8); public override Elastic.Clients.Elasticsearch.Streams.StreamsStatusResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLogs = default; + LocalJsonValue propLogs = default; + LocalJsonValue propLogsEcs = default; + LocalJsonValue propLogsOtel = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propLogs.TryReadProperty(ref reader, options, PropLogs, null)) @@ -38,6 +42,16 @@ public override Elastic.Clients.Elasticsearch.Streams.StreamsStatusResponse Read continue; } + if (propLogsEcs.TryReadProperty(ref reader, options, PropLogsEcs, null)) + { + continue; + } + + if (propLogsOtel.TryReadProperty(ref reader, options, PropLogsOtel, null)) + { + continue; + } + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) { reader.SafeSkip(); @@ -50,7 +64,9 @@ public override Elastic.Clients.Elasticsearch.Streams.StreamsStatusResponse Read reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); return new Elastic.Clients.Elasticsearch.Streams.StreamsStatusResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { - Logs = propLogs.Value + Logs = propLogs.Value, + LogsEcs = propLogsEcs.Value, + LogsOtel = propLogsOtel.Value }; } @@ -58,6 +74,8 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropLogs, value.Logs, null, null); + writer.WriteProperty(options, PropLogsEcs, value.LogsEcs, null, null); + writer.WriteProperty(options, PropLogsOtel, value.LogsOtel, null, null); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Streams/StreamsStatusResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Streams/StreamsStatusResponse.g.cs index 659ae1a035f..ca1b60299c6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Streams/StreamsStatusResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Streams/StreamsStatusResponse.g.cs @@ -37,5 +37,7 @@ internal StreamsStatusResponse(Elastic.Clients.Elasticsearch.Serialization.JsonC _ = sentinel; } - public required Elastic.Clients.Elasticsearch.Streams.LogsStatus Logs { get; set; } + public required Elastic.Clients.Elasticsearch.Streams.StreamStatus Logs { get; set; } + public required Elastic.Clients.Elasticsearch.Streams.StreamStatus LogsEcs { get; set; } + public required Elastic.Clients.Elasticsearch.Streams.StreamStatus LogsOtel { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindFieldStructureRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindFieldStructureRequest.g.cs index b91895264d4..c8f28cd9420 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindFieldStructureRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindFieldStructureRequest.g.cs @@ -115,6 +115,16 @@ public sealed partial class FindFieldStructureRequestParameters : Elastic.Transp /// public string? Quote { get => Q("quote"); set => Q("quote", value); } + /// + /// + /// If the format is ndjson, you can specify whether to parse nested JSON objects recursively. + /// The nested objects are parsed to a maximum depth equal to the default value of the index.mapping.depth.limit setting. + /// Anything beyond that depth is parsed as an object type field. + /// For formats other than ndjson, this parameter is ignored. + /// + /// + public bool? ShouldParseRecursively { get => Q("should_parse_recursively"); set => Q("should_parse_recursively", value); } + /// /// /// If the format is delimited, you can specify whether values between delimiters should have whitespace trimmed from them. @@ -429,6 +439,16 @@ internal FindFieldStructureRequest(Elastic.Clients.Elasticsearch.Serialization.J /// public string? Quote { get => Q("quote"); set => Q("quote", value); } + /// + /// + /// If the format is ndjson, you can specify whether to parse nested JSON objects recursively. + /// The nested objects are parsed to a maximum depth equal to the default value of the index.mapping.depth.limit setting. + /// Anything beyond that depth is parsed as an object type field. + /// For formats other than ndjson, this parameter is ignored. + /// + /// + public bool? ShouldParseRecursively { get => Q("should_parse_recursively"); set => Q("should_parse_recursively", value); } + /// /// /// If the format is delimited, you can specify whether values between delimiters should have whitespace trimmed from them. @@ -804,6 +824,20 @@ public Elastic.Clients.Elasticsearch.TextStructure.FindFieldStructureRequestDesc return this; } + /// + /// + /// If the format is ndjson, you can specify whether to parse nested JSON objects recursively. + /// The nested objects are parsed to a maximum depth equal to the default value of the index.mapping.depth.limit setting. + /// Anything beyond that depth is parsed as an object type field. + /// For formats other than ndjson, this parameter is ignored. + /// + /// + public Elastic.Clients.Elasticsearch.TextStructure.FindFieldStructureRequestDescriptor ShouldParseRecursively(bool? value = true) + { + Instance.ShouldParseRecursively = value; + return this; + } + /// /// /// If the format is delimited, you can specify whether values between delimiters should have whitespace trimmed from them. @@ -1278,6 +1312,20 @@ public Elastic.Clients.Elasticsearch.TextStructure.FindFieldStructureRequestDesc return this; } + /// + /// + /// If the format is ndjson, you can specify whether to parse nested JSON objects recursively. + /// The nested objects are parsed to a maximum depth equal to the default value of the index.mapping.depth.limit setting. + /// Anything beyond that depth is parsed as an object type field. + /// For formats other than ndjson, this parameter is ignored. + /// + /// + public Elastic.Clients.Elasticsearch.TextStructure.FindFieldStructureRequestDescriptor ShouldParseRecursively(bool? value = true) + { + Instance.ShouldParseRecursively = value; + return this; + } + /// /// /// If the format is delimited, you can specify whether values between delimiters should have whitespace trimmed from them. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindMessageStructureRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindMessageStructureRequest.g.cs index a0ed7b489dc..457e4baa3a9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindMessageStructureRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindMessageStructureRequest.g.cs @@ -92,6 +92,16 @@ public sealed partial class FindMessageStructureRequestParameters : Elastic.Tran /// public string? Quote { get => Q("quote"); set => Q("quote", value); } + /// + /// + /// If the format is ndjson, you can specify whether to parse nested JSON objects recursively. + /// The nested objects are parsed to a maximum depth equal to the default value of the index.mapping.depth.limit setting. + /// Anything beyond that depth is parsed as an object type field. + /// For formats other than ndjson, this parameter is ignored. + /// + /// + public bool? ShouldParseRecursively { get => Q("should_parse_recursively"); set => Q("should_parse_recursively", value); } + /// /// /// If the format is delimited, you can specify whether values between delimiters should have whitespace trimmed from them. @@ -386,6 +396,16 @@ internal FindMessageStructureRequest(Elastic.Clients.Elasticsearch.Serialization /// public string? Quote { get => Q("quote"); set => Q("quote", value); } + /// + /// + /// If the format is ndjson, you can specify whether to parse nested JSON objects recursively. + /// The nested objects are parsed to a maximum depth equal to the default value of the index.mapping.depth.limit setting. + /// Anything beyond that depth is parsed as an object type field. + /// For formats other than ndjson, this parameter is ignored. + /// + /// + public bool? ShouldParseRecursively { get => Q("should_parse_recursively"); set => Q("should_parse_recursively", value); } + /// /// /// If the format is delimited, you can specify whether values between delimiters should have whitespace trimmed from them. @@ -719,6 +739,20 @@ public Elastic.Clients.Elasticsearch.TextStructure.FindMessageStructureRequestDe return this; } + /// + /// + /// If the format is ndjson, you can specify whether to parse nested JSON objects recursively. + /// The nested objects are parsed to a maximum depth equal to the default value of the index.mapping.depth.limit setting. + /// Anything beyond that depth is parsed as an object type field. + /// For formats other than ndjson, this parameter is ignored. + /// + /// + public Elastic.Clients.Elasticsearch.TextStructure.FindMessageStructureRequestDescriptor ShouldParseRecursively(bool? value = true) + { + Instance.ShouldParseRecursively = value; + return this; + } + /// /// /// If the format is delimited, you can specify whether values between delimiters should have whitespace trimmed from them. @@ -1161,6 +1195,20 @@ public Elastic.Clients.Elasticsearch.TextStructure.FindMessageStructureRequestDe return this; } + /// + /// + /// If the format is ndjson, you can specify whether to parse nested JSON objects recursively. + /// The nested objects are parsed to a maximum depth equal to the default value of the index.mapping.depth.limit setting. + /// Anything beyond that depth is parsed as an object type field. + /// For formats other than ndjson, this parameter is ignored. + /// + /// + public Elastic.Clients.Elasticsearch.TextStructure.FindMessageStructureRequestDescriptor ShouldParseRecursively(bool? value = true) + { + Instance.ShouldParseRecursively = value; + return this; + } + /// /// /// If the format is delimited, you can specify whether values between delimiters should have whitespace trimmed from them. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryResponse.Converters.g.cs index 4166676a11c..fd901551c70 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryResponse.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryResponse.Converters.g.cs @@ -31,6 +31,7 @@ public sealed partial class UpdateByQueryResponseConverter : System.Text.Json.Se private static readonly System.Text.Json.JsonEncodedText PropNoops = System.Text.Json.JsonEncodedText.Encode("noops"u8); private static readonly System.Text.Json.JsonEncodedText PropRequestsPerSecond = System.Text.Json.JsonEncodedText.Encode("requests_per_second"u8); private static readonly System.Text.Json.JsonEncodedText PropRetries = System.Text.Json.JsonEncodedText.Encode("retries"u8); + private static readonly System.Text.Json.JsonEncodedText PropSlices = System.Text.Json.JsonEncodedText.Encode("slices"u8); private static readonly System.Text.Json.JsonEncodedText PropTask = System.Text.Json.JsonEncodedText.Encode("task"u8); private static readonly System.Text.Json.JsonEncodedText PropThrottled = System.Text.Json.JsonEncodedText.Encode("throttled"u8); private static readonly System.Text.Json.JsonEncodedText PropThrottledMillis = System.Text.Json.JsonEncodedText.Encode("throttled_millis"u8); @@ -51,6 +52,7 @@ public override Elastic.Clients.Elasticsearch.UpdateByQueryResponse Read(ref Sys LocalJsonValue propNoops = default; LocalJsonValue propRequestsPerSecond = default; LocalJsonValue propRetries = default; + LocalJsonValue?> propSlices = default; LocalJsonValue propTask = default; LocalJsonValue propThrottled = default; LocalJsonValue propThrottledMillis = default; @@ -93,6 +95,11 @@ public override Elastic.Clients.Elasticsearch.UpdateByQueryResponse Read(ref Sys continue; } + if (propSlices.TryReadProperty(ref reader, options, PropSlices, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + if (propTask.TryReadProperty(ref reader, options, PropTask, null)) { continue; @@ -161,6 +168,7 @@ public override Elastic.Clients.Elasticsearch.UpdateByQueryResponse Read(ref Sys Noops = propNoops.Value, RequestsPerSecond = propRequestsPerSecond.Value, Retries = propRetries.Value, + Slices = propSlices.Value, Task = propTask.Value, Throttled = propThrottled.Value, ThrottledMillis = propThrottledMillis.Value, @@ -183,6 +191,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropNoops, value.Noops, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropRequestsPerSecond, value.RequestsPerSecond, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropRetries, value.Retries, null, null); + writer.WriteProperty(options, PropSlices, value.Slices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); writer.WriteProperty(options, PropTask, value.Task, null, null); writer.WriteProperty(options, PropThrottled, value.Throttled, null, null); writer.WriteProperty(options, PropThrottledMillis, value.ThrottledMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryResponse.g.cs index eb984d5e203..4fb501a18a8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryResponse.g.cs @@ -84,6 +84,13 @@ internal UpdateByQueryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonC /// /// public Elastic.Clients.Elasticsearch.Retries? Retries { get; set; } + + /// + /// + /// Status of each slice if the update by query was sliced + /// + /// + public System.Collections.Generic.IReadOnlyCollection? Slices { get; set; } public Elastic.Clients.Elasticsearch.TaskId? Task { get; set; } public Elastic.Clients.Elasticsearch.Duration? Throttled { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageResponse.Converters.g.cs index 7c8dedca067..7959026783d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageResponse.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageResponse.Converters.g.cs @@ -36,6 +36,7 @@ public sealed partial class XpackUsageResponseConverter : System.Text.Json.Seria private static readonly System.Text.Json.JsonEncodedText PropEnrich = System.Text.Json.JsonEncodedText.Encode("enrich"u8); private static readonly System.Text.Json.JsonEncodedText PropEql = System.Text.Json.JsonEncodedText.Encode("eql"u8); private static readonly System.Text.Json.JsonEncodedText PropFlattened = System.Text.Json.JsonEncodedText.Encode("flattened"u8); + private static readonly System.Text.Json.JsonEncodedText PropGpuVectorIndexing = System.Text.Json.JsonEncodedText.Encode("gpu_vector_indexing"u8); private static readonly System.Text.Json.JsonEncodedText PropGraph = System.Text.Json.JsonEncodedText.Encode("graph"u8); private static readonly System.Text.Json.JsonEncodedText PropHealthApi = System.Text.Json.JsonEncodedText.Encode("health_api"u8); private static readonly System.Text.Json.JsonEncodedText PropIlm = System.Text.Json.JsonEncodedText.Encode("ilm"u8); @@ -68,6 +69,7 @@ public override Elastic.Clients.Elasticsearch.Xpack.XpackUsageResponse Read(ref LocalJsonValue propEnrich = default; LocalJsonValue propEql = default; LocalJsonValue propFlattened = default; + LocalJsonValue propGpuVectorIndexing = default; LocalJsonValue propGraph = default; LocalJsonValue propHealthApi = default; LocalJsonValue propIlm = default; @@ -142,6 +144,11 @@ public override Elastic.Clients.Elasticsearch.Xpack.XpackUsageResponse Read(ref continue; } + if (propGpuVectorIndexing.TryReadProperty(ref reader, options, PropGpuVectorIndexing, null)) + { + continue; + } + if (propGraph.TryReadProperty(ref reader, options, PropGraph, null)) { continue; @@ -250,6 +257,7 @@ public override Elastic.Clients.Elasticsearch.Xpack.XpackUsageResponse Read(ref Enrich = propEnrich.Value, Eql = propEql.Value, Flattened = propFlattened.Value, + GpuVectorIndexing = propGpuVectorIndexing.Value, Graph = propGraph.Value, HealthApi = propHealthApi.Value, Ilm = propIlm.Value, @@ -284,6 +292,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropEnrich, value.Enrich, null, null); writer.WriteProperty(options, PropEql, value.Eql, null, null); writer.WriteProperty(options, PropFlattened, value.Flattened, null, null); + writer.WriteProperty(options, PropGpuVectorIndexing, value.GpuVectorIndexing, null, null); writer.WriteProperty(options, PropGraph, value.Graph, null, null); writer.WriteProperty(options, PropHealthApi, value.HealthApi, null, null); writer.WriteProperty(options, PropIlm, value.Ilm, null, null); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageResponse.g.cs index 8c550c59b97..91986686cdf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageResponse.g.cs @@ -48,6 +48,7 @@ internal XpackUsageResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCons public Elastic.Clients.Elasticsearch.Xpack.Base? Enrich { get; set; } public required Elastic.Clients.Elasticsearch.Xpack.Eql Eql { get; set; } public Elastic.Clients.Elasticsearch.Xpack.Flattened? Flattened { get; set; } + public Elastic.Clients.Elasticsearch.Xpack.GpuVectorIndexing? GpuVectorIndexing { get; set; } public required Elastic.Clients.Elasticsearch.Xpack.Base Graph { get; set; } public Elastic.Clients.Elasticsearch.Xpack.HealthStatistics? HealthApi { get; set; } public required Elastic.Clients.Elasticsearch.Xpack.Ilm Ilm { get; set; } 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 c81e7f92f05..b01738590c5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Esql.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Esql.g.cs @@ -224,6 +224,52 @@ public virtual Elastic.Clients.Elasticsearch.Esql.AsyncQueryStopResponse AsyncQu return DoRequestAsync(request, cancellationToken); } + public virtual Elastic.Clients.Elasticsearch.Esql.DeleteViewResponse DeleteView(Elastic.Clients.Elasticsearch.Esql.DeleteViewRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Esql.DeleteViewResponse DeleteView(Elastic.Clients.Elasticsearch.Id name) + { + var builder = new Elastic.Clients.Elasticsearch.Esql.DeleteViewRequestDescriptor(name); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Esql.DeleteViewResponse DeleteView(Elastic.Clients.Elasticsearch.Id name, System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Esql.DeleteViewRequestDescriptor(name); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual System.Threading.Tasks.Task DeleteViewAsync(Elastic.Clients.Elasticsearch.Esql.DeleteViewRequest request, System.Threading.CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task DeleteViewAsync(Elastic.Clients.Elasticsearch.Id name, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Esql.DeleteViewRequestDescriptor(name); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task DeleteViewAsync(Elastic.Clients.Elasticsearch.Id name, System.Action action, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Esql.DeleteViewRequestDescriptor(name); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + public virtual Elastic.Clients.Elasticsearch.Esql.GetEsqlQueryResponse GetQuery(Elastic.Clients.Elasticsearch.Esql.GetEsqlQueryRequest request) { request.BeforeRequest(); @@ -270,6 +316,86 @@ public virtual Elastic.Clients.Elasticsearch.Esql.GetEsqlQueryResponse GetQuery( return DoRequestAsync(request, cancellationToken); } + public virtual Elastic.Clients.Elasticsearch.Esql.GetViewResponse GetView(Elastic.Clients.Elasticsearch.Esql.GetViewRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Esql.GetViewResponse GetView() + { + var builder = new Elastic.Clients.Elasticsearch.Esql.GetViewRequestDescriptor(); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Esql.GetViewResponse GetView(System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Esql.GetViewRequestDescriptor(); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Esql.GetViewResponse GetView(Elastic.Clients.Elasticsearch.Id? name) + { + var builder = new Elastic.Clients.Elasticsearch.Esql.GetViewRequestDescriptor(name); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Esql.GetViewResponse GetView(Elastic.Clients.Elasticsearch.Id? name, System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Esql.GetViewRequestDescriptor(name); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual System.Threading.Tasks.Task GetViewAsync(Elastic.Clients.Elasticsearch.Esql.GetViewRequest request, System.Threading.CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task GetViewAsync(System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Esql.GetViewRequestDescriptor(); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task GetViewAsync(System.Action action, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Esql.GetViewRequestDescriptor(); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task GetViewAsync(Elastic.Clients.Elasticsearch.Id? name, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Esql.GetViewRequestDescriptor(name); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task GetViewAsync(Elastic.Clients.Elasticsearch.Id? name, System.Action action, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Esql.GetViewRequestDescriptor(name); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + public virtual Elastic.Clients.Elasticsearch.Esql.ListQueriesResponse ListQueries(Elastic.Clients.Elasticsearch.Esql.ListQueriesRequest request) { request.BeforeRequest(); @@ -316,6 +442,52 @@ public virtual Elastic.Clients.Elasticsearch.Esql.ListQueriesResponse ListQuerie return DoRequestAsync(request, cancellationToken); } + public virtual Elastic.Clients.Elasticsearch.Esql.PutViewResponse PutView(Elastic.Clients.Elasticsearch.Esql.PutViewRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Esql.PutViewResponse PutView(Elastic.Clients.Elasticsearch.Id name) + { + var builder = new Elastic.Clients.Elasticsearch.Esql.PutViewRequestDescriptor(name); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Esql.PutViewResponse PutView(Elastic.Clients.Elasticsearch.Id name, System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Esql.PutViewRequestDescriptor(name); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual System.Threading.Tasks.Task PutViewAsync(Elastic.Clients.Elasticsearch.Esql.PutViewRequest request, System.Threading.CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task PutViewAsync(Elastic.Clients.Elasticsearch.Id name, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Esql.PutViewRequestDescriptor(name); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task PutViewAsync(Elastic.Clients.Elasticsearch.Id name, System.Action action, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Esql.PutViewRequestDescriptor(name); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + public virtual Elastic.Clients.Elasticsearch.Esql.EsqlQueryResponse Query(Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequest request) { request.BeforeRequest(); 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 301b11c6159..68c03535e96 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Indices.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Indices.g.cs @@ -1248,104 +1248,6 @@ public virtual Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexTemplate return DoRequestAsync(request, cancellationToken); } - public virtual Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationResponse DeleteSampleConfiguration(Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequest request) - { - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationResponse DeleteSampleConfiguration(Elastic.Clients.Elasticsearch.IndexName index) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor(index); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationResponse DeleteSampleConfiguration(Elastic.Clients.Elasticsearch.IndexName index, System.Action action) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor(index); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationResponse DeleteSampleConfiguration() - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor(); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationResponse DeleteSampleConfiguration(System.Action> action) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor(); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationResponse DeleteSampleConfiguration(Elastic.Clients.Elasticsearch.IndexName index, System.Action> action) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor(index); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual System.Threading.Tasks.Task DeleteSampleConfigurationAsync(Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default) - { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task DeleteSampleConfigurationAsync(Elastic.Clients.Elasticsearch.IndexName index, System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor(index); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task DeleteSampleConfigurationAsync(Elastic.Clients.Elasticsearch.IndexName index, System.Action action, System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor(index); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task DeleteSampleConfigurationAsync(System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor(); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task DeleteSampleConfigurationAsync(System.Action> action, System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor(); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task DeleteSampleConfigurationAsync(Elastic.Clients.Elasticsearch.IndexName index, System.Action> action, System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.DeleteSampleConfigurationRequestDescriptor(index); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - public virtual Elastic.Clients.Elasticsearch.IndexManagement.DeleteTemplateResponse DeleteTemplate(Elastic.Clients.Elasticsearch.IndexManagement.DeleteTemplateRequest request) { request.BeforeRequest(); @@ -2658,52 +2560,6 @@ public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetAliasResponse Ge return DoRequestAsync(request, cancellationToken); } - public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationResponse GetAllSampleConfiguration(Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequest request) - { - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationResponse GetAllSampleConfiguration() - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequestDescriptor(); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationResponse GetAllSampleConfiguration(System.Action action) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequestDescriptor(); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual System.Threading.Tasks.Task GetAllSampleConfigurationAsync(Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default) - { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task GetAllSampleConfigurationAsync(System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequestDescriptor(); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task GetAllSampleConfigurationAsync(System.Action action, System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetAllSampleConfigurationRequestDescriptor(); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleResponse GetDataLifecycle(Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleRequest request) { request.BeforeRequest(); @@ -3544,300 +3400,6 @@ public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetMigrateReindexSt return DoRequestAsync(request, cancellationToken); } - public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleResponse GetSample(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest request) - { - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleResponse GetSample(Elastic.Clients.Elasticsearch.IndexName index) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(index); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleResponse GetSample(Elastic.Clients.Elasticsearch.IndexName index, System.Action action) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(index); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleResponse GetSample() - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleResponse GetSample(System.Action> action) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleResponse GetSample(Elastic.Clients.Elasticsearch.IndexName index, System.Action> action) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(index); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual System.Threading.Tasks.Task GetSampleAsync(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest request, System.Threading.CancellationToken cancellationToken = default) - { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task GetSampleAsync(Elastic.Clients.Elasticsearch.IndexName index, System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(index); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task GetSampleAsync(Elastic.Clients.Elasticsearch.IndexName index, System.Action action, System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(index); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task GetSampleAsync(System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task GetSampleAsync(System.Action> action, System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task GetSampleAsync(Elastic.Clients.Elasticsearch.IndexName index, System.Action> action, System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(index); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationResponse GetSampleConfiguration(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequest request) - { - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationResponse GetSampleConfiguration(Elastic.Clients.Elasticsearch.IndexName index) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor(index); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationResponse GetSampleConfiguration(Elastic.Clients.Elasticsearch.IndexName index, System.Action action) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor(index); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationResponse GetSampleConfiguration() - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor(); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationResponse GetSampleConfiguration(System.Action> action) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor(); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationResponse GetSampleConfiguration(Elastic.Clients.Elasticsearch.IndexName index, System.Action> action) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor(index); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual System.Threading.Tasks.Task GetSampleConfigurationAsync(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default) - { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task GetSampleConfigurationAsync(Elastic.Clients.Elasticsearch.IndexName index, System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor(index); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task GetSampleConfigurationAsync(Elastic.Clients.Elasticsearch.IndexName index, System.Action action, System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor(index); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task GetSampleConfigurationAsync(System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor(); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task GetSampleConfigurationAsync(System.Action> action, System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor(); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task GetSampleConfigurationAsync(Elastic.Clients.Elasticsearch.IndexName index, System.Action> action, System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleConfigurationRequestDescriptor(index); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsResponse GetSampleStats(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest request) - { - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsResponse GetSampleStats(Elastic.Clients.Elasticsearch.IndexName index) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(index); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsResponse GetSampleStats(Elastic.Clients.Elasticsearch.IndexName index, System.Action action) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(index); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsResponse GetSampleStats() - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsResponse GetSampleStats(System.Action> action) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsResponse GetSampleStats(Elastic.Clients.Elasticsearch.IndexName index, System.Action> action) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(index); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual System.Threading.Tasks.Task GetSampleStatsAsync(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest request, System.Threading.CancellationToken cancellationToken = default) - { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task GetSampleStatsAsync(Elastic.Clients.Elasticsearch.IndexName index, System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(index); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task GetSampleStatsAsync(Elastic.Clients.Elasticsearch.IndexName index, System.Action action, System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(index); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task GetSampleStatsAsync(System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task GetSampleStatsAsync(System.Action> action, System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task GetSampleStatsAsync(Elastic.Clients.Elasticsearch.IndexName index, System.Action> action, System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(index); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetIndicesSettingsResponse GetSettings(Elastic.Clients.Elasticsearch.IndexManagement.GetIndicesSettingsRequest request) { request.BeforeRequest(); @@ -5030,104 +4592,6 @@ public virtual Elastic.Clients.Elasticsearch.IndexManagement.PutMappingResponse return DoRequestAsync(request, cancellationToken); } - public virtual Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationResponse PutSampleConfiguration(Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequest request) - { - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationResponse PutSampleConfiguration(Elastic.Clients.Elasticsearch.IndexName index) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor(index); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationResponse PutSampleConfiguration(Elastic.Clients.Elasticsearch.IndexName index, System.Action action) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor(index); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationResponse PutSampleConfiguration() - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor(); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationResponse PutSampleConfiguration(System.Action> action) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor(); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationResponse PutSampleConfiguration(Elastic.Clients.Elasticsearch.IndexName index, System.Action> action) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor(index); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual System.Threading.Tasks.Task PutSampleConfigurationAsync(Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default) - { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task PutSampleConfigurationAsync(Elastic.Clients.Elasticsearch.IndexName index, System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor(index); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task PutSampleConfigurationAsync(Elastic.Clients.Elasticsearch.IndexName index, System.Action action, System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor(index); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task PutSampleConfigurationAsync(System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor(); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task PutSampleConfigurationAsync(System.Action> action, System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor(); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task PutSampleConfigurationAsync(Elastic.Clients.Elasticsearch.IndexName index, System.Action> action, System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.PutSampleConfigurationRequestDescriptor(index); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - public virtual Elastic.Clients.Elasticsearch.IndexManagement.PutIndicesSettingsResponse PutSettings(Elastic.Clients.Elasticsearch.IndexManagement.PutIndicesSettingsRequest request) { request.BeforeRequest(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Inference.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Inference.g.cs index fe5ba93d062..e1eb983f7c0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Inference.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Inference.g.cs @@ -210,6 +210,52 @@ public virtual Elastic.Clients.Elasticsearch.Inference.DeleteInferenceResponse D return DoRequestAsync(request, cancellationToken); } + public virtual Elastic.Clients.Elasticsearch.Inference.EmbeddingResponse Embedding(Elastic.Clients.Elasticsearch.Inference.EmbeddingRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Inference.EmbeddingResponse Embedding(Elastic.Clients.Elasticsearch.Id inferenceId) + { + var builder = new Elastic.Clients.Elasticsearch.Inference.EmbeddingRequestDescriptor(inferenceId); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Inference.EmbeddingResponse Embedding(Elastic.Clients.Elasticsearch.Id inferenceId, System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Inference.EmbeddingRequestDescriptor(inferenceId); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual System.Threading.Tasks.Task EmbeddingAsync(Elastic.Clients.Elasticsearch.Inference.EmbeddingRequest request, System.Threading.CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task EmbeddingAsync(Elastic.Clients.Elasticsearch.Id inferenceId, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Inference.EmbeddingRequestDescriptor(inferenceId); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task EmbeddingAsync(Elastic.Clients.Elasticsearch.Id inferenceId, System.Action action, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Inference.EmbeddingRequestDescriptor(inferenceId); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + public virtual Elastic.Clients.Elasticsearch.Inference.GetInferenceResponse Get(Elastic.Clients.Elasticsearch.Inference.GetInferenceRequest request) { request.BeforeRequest(); @@ -267,6 +313,23 @@ public virtual Elastic.Clients.Elasticsearch.Inference.GetInferenceResponse Get( return DoRequest(request); } + public virtual Elastic.Clients.Elasticsearch.Inference.GetInferenceResponse Get(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType) + { + var builder = new Elastic.Clients.Elasticsearch.Inference.GetInferenceRequestDescriptor(taskType); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Inference.GetInferenceResponse Get(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType, System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Inference.GetInferenceRequestDescriptor(taskType); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + public virtual System.Threading.Tasks.Task GetAsync(Elastic.Clients.Elasticsearch.Inference.GetInferenceRequest request, System.Threading.CancellationToken cancellationToken = default) { request.BeforeRequest(); @@ -324,6 +387,23 @@ public virtual Elastic.Clients.Elasticsearch.Inference.GetInferenceResponse Get( return DoRequestAsync(request, cancellationToken); } + public virtual System.Threading.Tasks.Task GetAsync(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Inference.GetInferenceRequestDescriptor(taskType); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task GetAsync(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType, System.Action action, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Inference.GetInferenceRequestDescriptor(taskType); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + public virtual Elastic.Clients.Elasticsearch.Inference.InferenceResponse Inference(Elastic.Clients.Elasticsearch.Inference.InferenceRequest request) { request.BeforeRequest(); @@ -1086,6 +1166,52 @@ public virtual Elastic.Clients.Elasticsearch.Inference.PutElserResponse PutElser return DoRequestAsync(request, cancellationToken); } + public virtual Elastic.Clients.Elasticsearch.Inference.PutFireworksaiResponse PutFireworksai(Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Inference.PutFireworksaiResponse PutFireworksai(Elastic.Clients.Elasticsearch.Inference.FireworksAITaskType taskType, Elastic.Clients.Elasticsearch.Id fireworksaiInferenceId) + { + var builder = new Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequestDescriptor(taskType, fireworksaiInferenceId); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Inference.PutFireworksaiResponse PutFireworksai(Elastic.Clients.Elasticsearch.Inference.FireworksAITaskType taskType, Elastic.Clients.Elasticsearch.Id fireworksaiInferenceId, System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequestDescriptor(taskType, fireworksaiInferenceId); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual System.Threading.Tasks.Task PutFireworksaiAsync(Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequest request, System.Threading.CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task PutFireworksaiAsync(Elastic.Clients.Elasticsearch.Inference.FireworksAITaskType taskType, Elastic.Clients.Elasticsearch.Id fireworksaiInferenceId, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequestDescriptor(taskType, fireworksaiInferenceId); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task PutFireworksaiAsync(Elastic.Clients.Elasticsearch.Inference.FireworksAITaskType taskType, Elastic.Clients.Elasticsearch.Id fireworksaiInferenceId, System.Action action, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Inference.PutFireworksaiRequestDescriptor(taskType, fireworksaiInferenceId); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + public virtual Elastic.Clients.Elasticsearch.Inference.PutGoogleaistudioResponse PutGoogleaistudio(Elastic.Clients.Elasticsearch.Inference.PutGoogleaistudioRequest request) { request.BeforeRequest(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Project.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Project.g.cs index 6ff5cf2367f..be4c69963f9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Project.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Project.g.cs @@ -38,6 +38,220 @@ internal ProjectNamespacedClient(Elastic.Clients.Elasticsearch.ElasticsearchClie { } + public virtual Elastic.Clients.Elasticsearch.Project.CreateManyRoutingResponse CreateManyRouting(Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Project.CreateManyRoutingResponse CreateManyRouting(System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequestDescriptor(); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual System.Threading.Tasks.Task CreateManyRoutingAsync(Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequest request, System.Threading.CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task CreateManyRoutingAsync(System.Action action, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Project.CreateManyRoutingRequestDescriptor(); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual Elastic.Clients.Elasticsearch.Project.CreateRoutingResponse CreateRouting(Elastic.Clients.Elasticsearch.Project.CreateRoutingRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Project.CreateRoutingResponse CreateRouting(string name) + { + var builder = new Elastic.Clients.Elasticsearch.Project.CreateRoutingRequestDescriptor(name); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Project.CreateRoutingResponse CreateRouting(string name, System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Project.CreateRoutingRequestDescriptor(name); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual System.Threading.Tasks.Task CreateRoutingAsync(Elastic.Clients.Elasticsearch.Project.CreateRoutingRequest request, System.Threading.CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task CreateRoutingAsync(string name, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Project.CreateRoutingRequestDescriptor(name); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task CreateRoutingAsync(string name, System.Action action, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Project.CreateRoutingRequestDescriptor(name); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual Elastic.Clients.Elasticsearch.Project.DeleteRoutingResponse DeleteRouting(Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Project.DeleteRoutingResponse DeleteRouting(string name) + { + var builder = new Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequestDescriptor(name); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Project.DeleteRoutingResponse DeleteRouting(string name, System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequestDescriptor(name); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual System.Threading.Tasks.Task DeleteRoutingAsync(Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequest request, System.Threading.CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task DeleteRoutingAsync(string name, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequestDescriptor(name); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task DeleteRoutingAsync(string name, System.Action action, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Project.DeleteRoutingRequestDescriptor(name); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual Elastic.Clients.Elasticsearch.Project.GetManyRoutingResponse GetManyRouting(Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Project.GetManyRoutingResponse GetManyRouting() + { + var builder = new Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequestDescriptor(); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Project.GetManyRoutingResponse GetManyRouting(System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequestDescriptor(); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual System.Threading.Tasks.Task GetManyRoutingAsync(Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequest request, System.Threading.CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task GetManyRoutingAsync(System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequestDescriptor(); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task GetManyRoutingAsync(System.Action action, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Project.GetManyRoutingRequestDescriptor(); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual Elastic.Clients.Elasticsearch.Project.GetRoutingResponse GetRouting(Elastic.Clients.Elasticsearch.Project.GetRoutingRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Project.GetRoutingResponse GetRouting(string name) + { + var builder = new Elastic.Clients.Elasticsearch.Project.GetRoutingRequestDescriptor(name); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Project.GetRoutingResponse GetRouting(string name, System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Project.GetRoutingRequestDescriptor(name); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual System.Threading.Tasks.Task GetRoutingAsync(Elastic.Clients.Elasticsearch.Project.GetRoutingRequest request, System.Threading.CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task GetRoutingAsync(string name, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Project.GetRoutingRequestDescriptor(name); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task GetRoutingAsync(string name, System.Action action, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Project.GetRoutingRequestDescriptor(name); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + public virtual Elastic.Clients.Elasticsearch.Project.TagsResponse Tags(Elastic.Clients.Elasticsearch.Project.TagsRequest request) { request.BeforeRequest(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Streams.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Streams.g.cs index 7bf1a08a061..129579c1590 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Streams.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Streams.g.cs @@ -44,17 +44,17 @@ public virtual Elastic.Clients.Elasticsearch.Streams.LogsDisableResponse LogsDis return DoRequest(request); } - public virtual Elastic.Clients.Elasticsearch.Streams.LogsDisableResponse LogsDisable() + public virtual Elastic.Clients.Elasticsearch.Streams.LogsDisableResponse LogsDisable(Elastic.Clients.Elasticsearch.Streams.StreamType name) { - var builder = new Elastic.Clients.Elasticsearch.Streams.LogsDisableRequestDescriptor(); + var builder = new Elastic.Clients.Elasticsearch.Streams.LogsDisableRequestDescriptor(name); var request = builder.Instance; request.BeforeRequest(); return DoRequest(request); } - public virtual Elastic.Clients.Elasticsearch.Streams.LogsDisableResponse LogsDisable(System.Action action) + public virtual Elastic.Clients.Elasticsearch.Streams.LogsDisableResponse LogsDisable(Elastic.Clients.Elasticsearch.Streams.StreamType name, System.Action action) { - var builder = new Elastic.Clients.Elasticsearch.Streams.LogsDisableRequestDescriptor(); + var builder = new Elastic.Clients.Elasticsearch.Streams.LogsDisableRequestDescriptor(name); action.Invoke(builder); var request = builder.Instance; request.BeforeRequest(); @@ -67,17 +67,17 @@ public virtual Elastic.Clients.Elasticsearch.Streams.LogsDisableResponse LogsDis return DoRequestAsync(request, cancellationToken); } - public virtual System.Threading.Tasks.Task LogsDisableAsync(System.Threading.CancellationToken cancellationToken = default) + public virtual System.Threading.Tasks.Task LogsDisableAsync(Elastic.Clients.Elasticsearch.Streams.StreamType name, System.Threading.CancellationToken cancellationToken = default) { - var builder = new Elastic.Clients.Elasticsearch.Streams.LogsDisableRequestDescriptor(); + var builder = new Elastic.Clients.Elasticsearch.Streams.LogsDisableRequestDescriptor(name); var request = builder.Instance; request.BeforeRequest(); return DoRequestAsync(request, cancellationToken); } - public virtual System.Threading.Tasks.Task LogsDisableAsync(System.Action action, System.Threading.CancellationToken cancellationToken = default) + public virtual System.Threading.Tasks.Task LogsDisableAsync(Elastic.Clients.Elasticsearch.Streams.StreamType name, System.Action action, System.Threading.CancellationToken cancellationToken = default) { - var builder = new Elastic.Clients.Elasticsearch.Streams.LogsDisableRequestDescriptor(); + var builder = new Elastic.Clients.Elasticsearch.Streams.LogsDisableRequestDescriptor(name); action.Invoke(builder); var request = builder.Instance; request.BeforeRequest(); @@ -90,17 +90,17 @@ public virtual Elastic.Clients.Elasticsearch.Streams.LogsEnableResponse LogsEnab return DoRequest(request); } - public virtual Elastic.Clients.Elasticsearch.Streams.LogsEnableResponse LogsEnable() + public virtual Elastic.Clients.Elasticsearch.Streams.LogsEnableResponse LogsEnable(Elastic.Clients.Elasticsearch.Streams.StreamType name) { - var builder = new Elastic.Clients.Elasticsearch.Streams.LogsEnableRequestDescriptor(); + var builder = new Elastic.Clients.Elasticsearch.Streams.LogsEnableRequestDescriptor(name); var request = builder.Instance; request.BeforeRequest(); return DoRequest(request); } - public virtual Elastic.Clients.Elasticsearch.Streams.LogsEnableResponse LogsEnable(System.Action action) + public virtual Elastic.Clients.Elasticsearch.Streams.LogsEnableResponse LogsEnable(Elastic.Clients.Elasticsearch.Streams.StreamType name, System.Action action) { - var builder = new Elastic.Clients.Elasticsearch.Streams.LogsEnableRequestDescriptor(); + var builder = new Elastic.Clients.Elasticsearch.Streams.LogsEnableRequestDescriptor(name); action.Invoke(builder); var request = builder.Instance; request.BeforeRequest(); @@ -113,17 +113,17 @@ public virtual Elastic.Clients.Elasticsearch.Streams.LogsEnableResponse LogsEnab return DoRequestAsync(request, cancellationToken); } - public virtual System.Threading.Tasks.Task LogsEnableAsync(System.Threading.CancellationToken cancellationToken = default) + public virtual System.Threading.Tasks.Task LogsEnableAsync(Elastic.Clients.Elasticsearch.Streams.StreamType name, System.Threading.CancellationToken cancellationToken = default) { - var builder = new Elastic.Clients.Elasticsearch.Streams.LogsEnableRequestDescriptor(); + var builder = new Elastic.Clients.Elasticsearch.Streams.LogsEnableRequestDescriptor(name); var request = builder.Instance; request.BeforeRequest(); return DoRequestAsync(request, cancellationToken); } - public virtual System.Threading.Tasks.Task LogsEnableAsync(System.Action action, System.Threading.CancellationToken cancellationToken = default) + public virtual System.Threading.Tasks.Task LogsEnableAsync(Elastic.Clients.Elasticsearch.Streams.StreamType name, System.Action action, System.Threading.CancellationToken cancellationToken = default) { - var builder = new Elastic.Clients.Elasticsearch.Streams.LogsEnableRequestDescriptor(); + var builder = new Elastic.Clients.Elasticsearch.Streams.LogsEnableRequestDescriptor(name); action.Invoke(builder); var request = builder.Instance; request.BeforeRequest(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Fluent/FluentDictionaryOfStringProjectRoutingExpression.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Fluent/FluentDictionaryOfStringProjectRoutingExpression.g.cs new file mode 100644 index 00000000000..9253bbe12c1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Fluent/FluentDictionaryOfStringProjectRoutingExpression.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Fluent; + +public readonly partial struct FluentDictionaryOfStringProjectRoutingExpression +{ + private readonly System.Collections.Generic.Dictionary _items = new(); + + private System.Collections.Generic.IDictionary Value => _items; + + public FluentDictionaryOfStringProjectRoutingExpression() + { + } + + public Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringProjectRoutingExpression Add(string key, Elastic.Clients.Elasticsearch.Project.ProjectRoutingExpression value) + { + _items.Add(key, value); + return this; + } + + public Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringProjectRoutingExpression Add(string key, System.Action action) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Project.ProjectRoutingExpressionDescriptor.Build(action)); + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static System.Collections.Generic.IDictionary Build(System.Action? action) + { + if (action is null) + { + return new System.Collections.Generic.Dictionary(); + } + + var builder = new Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringProjectRoutingExpression(); + action.Invoke(builder); + return builder.Value; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermLookup.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermLookup.Converters.g.cs index 44a6c60e4d5..707c9aff1ce 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermLookup.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermLookup.Converters.g.cs @@ -25,23 +25,36 @@ namespace Elastic.Clients.Elasticsearch.Aggregations.Json; public sealed partial class MultiTermLookupConverter : System.Text.Json.Serialization.JsonConverter { - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"u8); private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"u8); + private static readonly System.Text.Json.JsonEncodedText VariantField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText VariantScript = System.Text.Json.JsonEncodedText.Encode("script"); public override Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookup Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; LocalJsonValue propMissing = default; + string? variantType = null; + object? variant = null; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { - if (propField.TryReadProperty(ref reader, options, PropField, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) { continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (reader.ValueTextEquals(VariantField)) { + variantType = VariantField.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantScript)) + { + variantType = VariantScript.Value; + reader.Read(); + variant = reader.ReadValue(options, null); continue; } @@ -57,7 +70,8 @@ public override Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookup Read( reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); return new Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookup(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { - Field = propField.Value, + VariantType = variantType, + Variant = variant, Missing = propMissing.Value }; } @@ -65,7 +79,20 @@ public override Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookup Read( public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookup value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); + switch (value.VariantType) + { + case null: + break; + case "field": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Field)value.Variant, null, null); + break; + case "script": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Script)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookup)}'."); + } + writer.WriteProperty(options, PropMissing, value.Missing, null, null); writer.WriteEndObject(); } 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 8293e58c2f3..8cd9323fc50 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermLookup.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermLookup.g.cs @@ -26,11 +26,8 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.MultiTermLookupConverter))] public sealed partial class MultiTermLookup { - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public MultiTermLookup(Elastic.Clients.Elasticsearch.Field field) - { - Field = field; - } + internal string? VariantType { get; set; } + internal object? Variant { get; set; } public MultiTermLookup() { @@ -44,10 +41,19 @@ internal MultiTermLookup(Elastic.Clients.Elasticsearch.Serialization.JsonConstru /// /// - /// A fields from which to retrieve terms. + /// A field from which to retrieve terms. + /// It is required if script is not provided. /// /// - public required Elastic.Clients.Elasticsearch.Field Field { get; set; } + public Elastic.Clients.Elasticsearch.Field? Field { get => GetVariant("field"); set => SetVariant("field", value); } + + /// + /// + /// A script to calculate terms to aggregate on. + /// It is required if field is not provided. + /// + /// + public Elastic.Clients.Elasticsearch.Script? Script { get => GetVariant("script"); set => SetVariant("script", value); } /// /// @@ -56,6 +62,27 @@ internal MultiTermLookup(Elastic.Clients.Elasticsearch.Serialization.JsonConstru /// /// public object? Missing { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookup(Elastic.Clients.Elasticsearch.Field value) => new Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookup { Field = value }; + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookup(Elastic.Clients.Elasticsearch.Script value) => new Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookup { Script = value }; + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private T? GetVariant(string type) + { + if (string.Equals(VariantType, type, System.StringComparison.Ordinal) && Variant is T result) + { + return result; + } + + return default; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private void SetVariant(string type, T? value) + { + VariantType = type; + Variant = value; + } } public readonly partial struct MultiTermLookupDescriptor @@ -79,10 +106,11 @@ public MultiTermLookupDescriptor() /// /// - /// A fields from which to retrieve terms. + /// A field from which to retrieve terms. + /// It is required if script is not provided. /// /// - public Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookupDescriptor Field(Elastic.Clients.Elasticsearch.Field value) + public Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookupDescriptor Field(Elastic.Clients.Elasticsearch.Field? value) { Instance.Field = value; return this; @@ -90,7 +118,8 @@ public Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookupDescriptor /// - /// A fields from which to retrieve terms. + /// A field from which to retrieve terms. + /// It is required if script is not provided. /// /// public Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookupDescriptor Field(System.Linq.Expressions.Expression> value) @@ -99,6 +128,42 @@ public Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookupDescriptor + /// + /// A script to calculate terms to aggregate on. + /// It is required if field is not provided. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookupDescriptor Script(Elastic.Clients.Elasticsearch.Script? value) + { + Instance.Script = value; + return this; + } + + /// + /// + /// A script to calculate terms to aggregate on. + /// It is required if field is not provided. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookupDescriptor Script() + { + Instance.Script = Elastic.Clients.Elasticsearch.ScriptDescriptor.Build(null); + return this; + } + + /// + /// + /// A script to calculate terms to aggregate on. + /// It is required if field is not provided. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookupDescriptor Script(System.Action? action) + { + Instance.Script = Elastic.Clients.Elasticsearch.ScriptDescriptor.Build(action); + return this; + } + /// /// /// The value to apply to documents that do not have a value. @@ -141,10 +206,11 @@ public MultiTermLookupDescriptor() /// /// - /// A fields from which to retrieve terms. + /// A field from which to retrieve terms. + /// It is required if script is not provided. /// /// - public Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookupDescriptor Field(Elastic.Clients.Elasticsearch.Field value) + public Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookupDescriptor Field(Elastic.Clients.Elasticsearch.Field? value) { Instance.Field = value; return this; @@ -152,7 +218,8 @@ public Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookupDescriptor Fiel /// /// - /// A fields from which to retrieve terms. + /// A field from which to retrieve terms. + /// It is required if script is not provided. /// /// public Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookupDescriptor Field(System.Linq.Expressions.Expression> value) @@ -161,6 +228,42 @@ public Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookupDescriptor Fiel return this; } + /// + /// + /// A script to calculate terms to aggregate on. + /// It is required if field is not provided. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookupDescriptor Script(Elastic.Clients.Elasticsearch.Script? value) + { + Instance.Script = value; + return this; + } + + /// + /// + /// A script to calculate terms to aggregate on. + /// It is required if field is not provided. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookupDescriptor Script() + { + Instance.Script = Elastic.Clients.Elasticsearch.ScriptDescriptor.Build(null); + return this; + } + + /// + /// + /// A script to calculate terms to aggregate on. + /// It is required if field is not provided. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookupDescriptor Script(System.Action? action) + { + Instance.Script = Elastic.Clients.Elasticsearch.ScriptDescriptor.Build(action); + return this; + } + /// /// /// The value to apply to documents that do not have a value. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedSearchUsage.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedSearchUsage.Converters.g.cs index 8a004b88526..fc84534ca45 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedSearchUsage.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedSearchUsage.Converters.g.cs @@ -26,11 +26,13 @@ namespace Elastic.Clients.Elasticsearch.Cluster.Json; public sealed partial class ExtendedSearchUsageConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropRetrievers = System.Text.Json.JsonEncodedText.Encode("retrievers"u8); + private static readonly System.Text.Json.JsonEncodedText PropSection = System.Text.Json.JsonEncodedText.Encode("section"u8); public override Elastic.Clients.Elasticsearch.Cluster.ExtendedSearchUsage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propRetrievers = default; + LocalJsonValue propSection = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propRetrievers.TryReadProperty(ref reader, options, PropRetrievers, null)) @@ -38,6 +40,11 @@ public override Elastic.Clients.Elasticsearch.Cluster.ExtendedSearchUsage Read(r continue; } + if (propSection.TryReadProperty(ref reader, options, PropSection, null)) + { + continue; + } + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) { reader.SafeSkip(); @@ -50,7 +57,8 @@ public override Elastic.Clients.Elasticsearch.Cluster.ExtendedSearchUsage Read(r reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); return new Elastic.Clients.Elasticsearch.Cluster.ExtendedSearchUsage(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { - Retrievers = propRetrievers.Value + Retrievers = propRetrievers.Value, + Section = propSection.Value }; } @@ -58,6 +66,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropRetrievers, value.Retrievers, null, null); + writer.WriteProperty(options, PropSection, value.Section, null, null); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedSearchUsage.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedSearchUsage.g.cs index 64aaac5871c..b64dd67bfee 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedSearchUsage.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedSearchUsage.g.cs @@ -37,4 +37,5 @@ internal ExtendedSearchUsage(Elastic.Clients.Elasticsearch.Serialization.JsonCon } public Elastic.Clients.Elasticsearch.Cluster.ExtendedRetrieversSearchUsage? Retrievers { get; set; } + public Elastic.Clients.Elasticsearch.Cluster.ExtendedSectionSearchUsage? Section { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSamplingConfiguration.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedSectionSearchUsage.Converters.g.cs similarity index 55% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSamplingConfiguration.Converters.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedSectionSearchUsage.Converters.g.cs index 50fdf29985a..3a87a229221 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSamplingConfiguration.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedSectionSearchUsage.Converters.g.cs @@ -21,26 +21,19 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; +namespace Elastic.Clients.Elasticsearch.Cluster.Json; -public sealed partial class IndexSamplingConfigurationConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class ExtendedSectionSearchUsageConverter : System.Text.Json.Serialization.JsonConverter { - private static readonly System.Text.Json.JsonEncodedText PropConfiguration = System.Text.Json.JsonEncodedText.Encode("configuration"u8); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"u8); + private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"u8); - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexSamplingConfiguration Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + public override Elastic.Clients.Elasticsearch.Cluster.ExtendedSectionSearchUsage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propConfiguration = default; - LocalJsonValue propIndex = default; + LocalJsonValue?> propSort = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { - if (propConfiguration.TryReadProperty(ref reader, options, PropConfiguration, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) { continue; } @@ -55,18 +48,16 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.IndexSamplingConfi } reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexSamplingConfiguration(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + return new Elastic.Clients.Elasticsearch.Cluster.ExtendedSectionSearchUsage(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { - Configuration = propConfiguration.Value, - Index = propIndex.Value + Sort = propSort.Value }; } - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexSamplingConfiguration value, System.Text.Json.JsonSerializerOptions options) + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ExtendedSectionSearchUsage value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); - writer.WriteProperty(options, PropConfiguration, value.Configuration, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedSectionSearchUsage.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedSectionSearchUsage.g.cs new file mode 100644 index 00000000000..991c287c81a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedSectionSearchUsage.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ExtendedSectionSearchUsageConverter))] +public sealed partial class ExtendedSectionSearchUsage +{ + public ExtendedSectionSearchUsage() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal ExtendedSectionSearchUsage(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public System.Collections.Generic.IReadOnlyDictionary? Sort { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SortType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SortType.Converters.g.cs new file mode 100644 index 00000000000..b580ced1df1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SortType.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class SortTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberDoc = System.Text.Json.JsonEncodedText.Encode("_doc"u8); + private static readonly System.Text.Json.JsonEncodedText MemberGeoDistance = System.Text.Json.JsonEncodedText.Encode("_geo_distance"u8); + private static readonly System.Text.Json.JsonEncodedText MemberScore = System.Text.Json.JsonEncodedText.Encode("_score"u8); + private static readonly System.Text.Json.JsonEncodedText MemberScript = System.Text.Json.JsonEncodedText.Encode("_script"u8); + private static readonly System.Text.Json.JsonEncodedText MemberFieldSort = System.Text.Json.JsonEncodedText.Encode("field_sort"u8); + + public override Elastic.Clients.Elasticsearch.Cluster.SortType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberDoc)) + { + return Elastic.Clients.Elasticsearch.Cluster.SortType.Doc; + } + + if (reader.ValueTextEquals(MemberGeoDistance)) + { + return Elastic.Clients.Elasticsearch.Cluster.SortType.GeoDistance; + } + + if (reader.ValueTextEquals(MemberScore)) + { + return Elastic.Clients.Elasticsearch.Cluster.SortType.Score; + } + + if (reader.ValueTextEquals(MemberScript)) + { + return Elastic.Clients.Elasticsearch.Cluster.SortType.Script; + } + + if (reader.ValueTextEquals(MemberFieldSort)) + { + return Elastic.Clients.Elasticsearch.Cluster.SortType.FieldSort; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberDoc.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.SortType.Doc; + } + + if (string.Equals(value, MemberGeoDistance.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.SortType.GeoDistance; + } + + if (string.Equals(value, MemberScore.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.SortType.Score; + } + + if (string.Equals(value, MemberScript.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.SortType.Script; + } + + if (string.Equals(value, MemberFieldSort.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.SortType.FieldSort; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Cluster.SortType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.SortType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Cluster.SortType.Doc: + writer.WriteStringValue(MemberDoc); + break; + case Elastic.Clients.Elasticsearch.Cluster.SortType.GeoDistance: + writer.WriteStringValue(MemberGeoDistance); + break; + case Elastic.Clients.Elasticsearch.Cluster.SortType.Score: + writer.WriteStringValue(MemberScore); + break; + case Elastic.Clients.Elasticsearch.Cluster.SortType.Script: + writer.WriteStringValue(MemberScript); + break; + case Elastic.Clients.Elasticsearch.Cluster.SortType.FieldSort: + writer.WriteStringValue(MemberFieldSort); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Cluster.SortType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Cluster.SortType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.SortType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SortType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SortType.g.cs new file mode 100644 index 00000000000..445bfe53124 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SortType.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.SortTypeConverter))] +public enum SortType +{ + [System.Runtime.Serialization.EnumMember(Value = "_doc")] + Doc, + [System.Runtime.Serialization.EnumMember(Value = "_geo_distance")] + GeoDistance, + [System.Runtime.Serialization.EnumMember(Value = "_score")] + Score, + [System.Runtime.Serialization.EnumMember(Value = "_script")] + Script, + [System.Runtime.Serialization.EnumMember(Value = "field_sort")] + FieldSort +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Destination.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Destination.Converters.g.cs index c597224a857..8dbc8c4356d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Destination.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Destination.Converters.g.cs @@ -37,7 +37,7 @@ public override Elastic.Clients.Elasticsearch.Core.Reindex.Destination Read(ref LocalJsonValue propIndex = default; LocalJsonValue propOpType = default; LocalJsonValue propPipeline = default; - LocalJsonValue propRouting = default; + LocalJsonValue propRouting = default; LocalJsonValue propVersionType = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Destination.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Destination.g.cs index 3dc8b780e27..87eb1d56611 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Destination.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Destination.g.cs @@ -74,7 +74,7 @@ internal Destination(Elastic.Clients.Elasticsearch.Serialization.JsonConstructor /// If it is =value, the routing on the bulk request sent for each match is set to all value specified after the equals sign (=). /// /// - public Elastic.Clients.Elasticsearch.Routing? Routing { get; set; } + public string? Routing { get; set; } /// /// @@ -147,7 +147,7 @@ public Elastic.Clients.Elasticsearch.Core.Reindex.DestinationDescriptor Pipeline /// If it is =value, the routing on the bulk request sent for each match is set to all value specified after the equals sign (=). /// /// - public Elastic.Clients.Elasticsearch.Core.Reindex.DestinationDescriptor Routing(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.Core.Reindex.DestinationDescriptor Routing(string? value) { Instance.Routing = value; return this; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Source.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Source.Converters.g.cs index 5c10265867f..21092745529 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Source.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Source.Converters.g.cs @@ -26,6 +26,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Reindex.Json; public sealed partial class SourceConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("index"u8); + private static readonly System.Text.Json.JsonEncodedText PropProjectRouting = System.Text.Json.JsonEncodedText.Encode("project_routing"u8); private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"u8); private static readonly System.Text.Json.JsonEncodedText PropRemote = System.Text.Json.JsonEncodedText.Encode("remote"u8); private static readonly System.Text.Json.JsonEncodedText PropRuntimeMappings = System.Text.Json.JsonEncodedText.Encode("runtime_mappings"u8); @@ -38,6 +39,7 @@ public override Elastic.Clients.Elasticsearch.Core.Reindex.Source Read(ref Syste { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propIndices = default; + LocalJsonValue propProjectRouting = default; LocalJsonValue propQuery = default; LocalJsonValue propRemote = default; LocalJsonValue?> propRuntimeMappings = default; @@ -52,6 +54,11 @@ public override Elastic.Clients.Elasticsearch.Core.Reindex.Source Read(ref Syste continue; } + if (propProjectRouting.TryReadProperty(ref reader, options, PropProjectRouting, null)) + { + continue; + } + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) { continue; @@ -100,6 +107,7 @@ public override Elastic.Clients.Elasticsearch.Core.Reindex.Source Read(ref Syste return new Elastic.Clients.Elasticsearch.Core.Reindex.Source(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Indices = propIndices.Value, + ProjectRouting = propProjectRouting.Value, Query = propQuery.Value, Remote = propRemote.Value, RuntimeMappings = propRuntimeMappings.Value, @@ -117,6 +125,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropIndices, value.Indices, null, null); + writer.WriteProperty(options, PropProjectRouting, value.ProjectRouting, null, null); writer.WriteProperty(options, PropQuery, value.Query, null, null); writer.WriteProperty(options, PropRemote, value.Remote, null, null); writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, 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 2755a05919d..7727133f66e 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 @@ -50,6 +50,20 @@ internal Source(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSenti /// public required Elastic.Clients.Elasticsearch.Indices Indices { get; set; } + /// + /// + /// Specifies a subset of projects to target for the search using project + /// metadata tags in a subset of Lucene query syntax. + /// Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + /// Examples: + /// _alias:my-project + /// _alias:_origin + /// _alias:pr + /// Supported in serverless only. + /// + /// + public string? ProjectRouting { get; set; } + /// /// /// The documents to reindex, which is defined with Query DSL. @@ -134,6 +148,24 @@ public Elastic.Clients.Elasticsearch.Core.Reindex.SourceDescriptor In return this; } + /// + /// + /// Specifies a subset of projects to target for the search using project + /// metadata tags in a subset of Lucene query syntax. + /// Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + /// Examples: + /// _alias:my-project + /// _alias:_origin + /// _alias:pr + /// Supported in serverless only. + /// + /// + public Elastic.Clients.Elasticsearch.Core.Reindex.SourceDescriptor ProjectRouting(string? value) + { + Instance.ProjectRouting = value; + return this; + } + /// /// /// The documents to reindex, which is defined with Query DSL. @@ -382,6 +414,24 @@ public Elastic.Clients.Elasticsearch.Core.Reindex.SourceDescriptor Indices(Elast return this; } + /// + /// + /// Specifies a subset of projects to target for the search using project + /// metadata tags in a subset of Lucene query syntax. + /// Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + /// Examples: + /// _alias:my-project + /// _alias:_origin + /// _alias:pr + /// Supported in serverless only. + /// + /// + public Elastic.Clients.Elasticsearch.Core.Reindex.SourceDescriptor ProjectRouting(string? value) + { + Instance.ProjectRouting = value; + return this; + } + /// /// /// The documents to reindex, which is defined with Query DSL. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ParentReindexTask.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ParentReindexTask.Converters.g.cs new file mode 100644 index 00000000000..7bb2075d274 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ParentReindexTask.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.Json; + +public sealed partial class ParentReindexTaskConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAction = System.Text.Json.JsonEncodedText.Encode("action"u8); + private static readonly System.Text.Json.JsonEncodedText PropCancellable = System.Text.Json.JsonEncodedText.Encode("cancellable"u8); + private static readonly System.Text.Json.JsonEncodedText PropCancelled = System.Text.Json.JsonEncodedText.Encode("cancelled"u8); + private static readonly System.Text.Json.JsonEncodedText PropChildren = System.Text.Json.JsonEncodedText.Encode("children"u8); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"u8); + private static readonly System.Text.Json.JsonEncodedText PropHeaders = System.Text.Json.JsonEncodedText.Encode("headers"u8); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"u8); + private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"u8); + private static readonly System.Text.Json.JsonEncodedText PropRunningTimeInNanos = System.Text.Json.JsonEncodedText.Encode("running_time_in_nanos"u8); + private static readonly System.Text.Json.JsonEncodedText PropStartTimeInMillis = System.Text.Json.JsonEncodedText.Encode("start_time_in_millis"u8); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"u8); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"u8); + + public override Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ParentReindexTask Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAction = default; + LocalJsonValue propCancellable = default; + LocalJsonValue propCancelled = default; + LocalJsonValue?> propChildren = default; + LocalJsonValue propDescription = default; + LocalJsonValue>> propHeaders = default; + LocalJsonValue propId = default; + LocalJsonValue propNode = default; + LocalJsonValue propRunningTimeInNanos = default; + LocalJsonValue propStartTimeInMillis = default; + LocalJsonValue propStatus = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAction.TryReadProperty(ref reader, options, PropAction, null)) + { + continue; + } + + if (propCancellable.TryReadProperty(ref reader, options, PropCancellable, null)) + { + continue; + } + + if (propCancelled.TryReadProperty(ref reader, options, PropCancelled, null)) + { + continue; + } + + if (propChildren.TryReadProperty(ref reader, options, PropChildren, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propHeaders.TryReadProperty(ref reader, options, PropHeaders, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)!)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propNode.TryReadProperty(ref reader, options, PropNode, null)) + { + continue; + } + + if (propRunningTimeInNanos.TryReadProperty(ref reader, options, PropRunningTimeInNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) + { + continue; + } + + if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ParentReindexTask(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Action = propAction.Value, + Cancellable = propCancellable.Value, + Cancelled = propCancelled.Value, + Children = propChildren.Value, + Description = propDescription.Value, + Headers = propHeaders.Value, + Id = propId.Value, + Node = propNode.Value, + RunningTimeInNanos = propRunningTimeInNanos.Value, + StartTimeInMillis = propStartTimeInMillis.Value, + Status = propStatus.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ParentReindexTask value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAction, value.Action, null, null); + writer.WriteProperty(options, PropCancellable, value.Cancellable, null, null); + writer.WriteProperty(options, PropCancelled, value.Cancelled, null, null); + writer.WriteProperty(options, PropChildren, value.Children, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropHeaders, value.Headers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropNode, value.Node, null, null); + writer.WriteProperty(options, PropRunningTimeInNanos, value.RunningTimeInNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); + writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ParentReindexTask.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ParentReindexTask.g.cs new file mode 100644 index 00000000000..f7c02b72937 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ParentReindexTask.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.ReindexRethrottle; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.Json.ParentReindexTaskConverter))] +public sealed partial class ParentReindexTask +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ParentReindexTask(string action, bool cancellable, bool cancelled, string description, System.Collections.Generic.IReadOnlyDictionary> headers, long id, string node, System.TimeSpan runningTimeInNanos, System.DateTimeOffset startTimeInMillis, Elastic.Clients.Elasticsearch.ReindexStatus status, string type) + { + Action = action; + Cancellable = cancellable; + Cancelled = cancelled; + Description = description; + Headers = headers; + Id = id; + Node = node; + RunningTimeInNanos = runningTimeInNanos; + StartTimeInMillis = startTimeInMillis; + Status = status; + Type = type; + } + + public ParentReindexTask() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal ParentReindexTask(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public required string Action { get; set; } + public required bool Cancellable { get; set; } + public required bool Cancelled { get; set; } + public System.Collections.Generic.IReadOnlyCollection? Children { get; set; } + public required string Description { get; set; } + public required System.Collections.Generic.IReadOnlyDictionary> Headers { get; set; } + public required long Id { get; set; } + public required string Node { get; set; } + public required System.TimeSpan RunningTimeInNanos { get; set; } + public required System.DateTimeOffset StartTimeInMillis { get; set; } + public required Elastic.Clients.Elasticsearch.ReindexStatus Status { get; set; } + public required string Type { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexTask.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexTask.Converters.g.cs index e1e8d24c9dd..a493a667681 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexTask.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexTask.Converters.g.cs @@ -27,6 +27,7 @@ public sealed partial class ReindexTaskConverter : System.Text.Json.Serializatio { private static readonly System.Text.Json.JsonEncodedText PropAction = System.Text.Json.JsonEncodedText.Encode("action"u8); private static readonly System.Text.Json.JsonEncodedText PropCancellable = System.Text.Json.JsonEncodedText.Encode("cancellable"u8); + private static readonly System.Text.Json.JsonEncodedText PropCancelled = System.Text.Json.JsonEncodedText.Encode("cancelled"u8); private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"u8); private static readonly System.Text.Json.JsonEncodedText PropHeaders = System.Text.Json.JsonEncodedText.Encode("headers"u8); private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"u8); @@ -41,13 +42,14 @@ public override Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexTask reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propAction = default; LocalJsonValue propCancellable = default; + LocalJsonValue propCancelled = default; LocalJsonValue propDescription = default; LocalJsonValue>> propHeaders = default; LocalJsonValue propId = default; LocalJsonValue propNode = default; LocalJsonValue propRunningTimeInNanos = default; LocalJsonValue propStartTimeInMillis = default; - LocalJsonValue propStatus = default; + LocalJsonValue propStatus = default; LocalJsonValue propType = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -61,6 +63,11 @@ public override Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexTask continue; } + if (propCancelled.TryReadProperty(ref reader, options, PropCancelled, null)) + { + continue; + } + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) { continue; @@ -115,6 +122,7 @@ public override Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexTask { Action = propAction.Value, Cancellable = propCancellable.Value, + Cancelled = propCancelled.Value, Description = propDescription.Value, Headers = propHeaders.Value, Id = propId.Value, @@ -131,6 +139,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteStartObject(); writer.WriteProperty(options, PropAction, value.Action, null, null); writer.WriteProperty(options, PropCancellable, value.Cancellable, null, null); + writer.WriteProperty(options, PropCancelled, value.Cancelled, null, null); writer.WriteProperty(options, PropDescription, value.Description, null, null); writer.WriteProperty(options, PropHeaders, value.Headers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); writer.WriteProperty(options, PropId, value.Id, null, null); 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 275f3aee31f..d4dc00286e8 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 @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.Core.ReindexRethrottle; public sealed partial class ReindexTask { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public ReindexTask(string action, bool cancellable, string description, System.Collections.Generic.IReadOnlyDictionary> headers, long id, string node, System.TimeSpan runningTimeInNanos, System.DateTimeOffset startTimeInMillis, Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexStatus status, string type) + public ReindexTask(string action, bool cancellable, bool cancelled, string description, System.Collections.Generic.IReadOnlyDictionary> headers, long id, string node, System.TimeSpan runningTimeInNanos, System.DateTimeOffset startTimeInMillis, Elastic.Clients.Elasticsearch.ReindexStatus status, string type) { Action = action; Cancellable = cancellable; + Cancelled = cancelled; Description = description; Headers = headers; Id = id; @@ -53,12 +54,13 @@ internal ReindexTask(Elastic.Clients.Elasticsearch.Serialization.JsonConstructor public required string Action { get; set; } public required bool Cancellable { get; set; } + public required bool Cancelled { get; set; } public required string Description { get; set; } public required System.Collections.Generic.IReadOnlyDictionary> Headers { get; set; } public required long Id { get; set; } public required string Node { get; set; } public required System.TimeSpan RunningTimeInNanos { get; set; } public required System.DateTimeOffset StartTimeInMillis { get; set; } - public required Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexStatus Status { get; set; } + public required Elastic.Clients.Elasticsearch.ReindexStatus Status { get; set; } public required string Type { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggestOption.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggestOption.Converters.g.cs index 6cca7d3ecfc..499fa340a3b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggestOption.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggestOption.Converters.g.cs @@ -44,7 +44,7 @@ public override Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggestOptio LocalJsonValue?> propFields = default; LocalJsonValue propId = default; LocalJsonValue propIndex = default; - LocalJsonValue?> propRouting = default; + LocalJsonValue propRouting = default; LocalJsonValue propScore = default; LocalJsonValue propScore0 = default; LocalJsonValue propSource = default; @@ -76,7 +76,7 @@ public override Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggestOptio continue; } - if (propRouting.TryReadProperty(ref reader, options, PropRouting, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) { continue; } @@ -134,7 +134,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); writer.WriteProperty(options, PropId, value.Id, null, null); writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropRouting, value.Routing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); writer.WriteProperty(options, PropScore, value.Score, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropScore0, value.Score0, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropSource, value.Source, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TDocument? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); 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 index 4495558413e..64843e4c68a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggestOption.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggestOption.g.cs @@ -47,7 +47,7 @@ internal CompletionSuggestOption(Elastic.Clients.Elasticsearch.Serialization.Jso public System.Collections.Generic.IReadOnlyDictionary? Fields { get; set; } public string? Id { get; set; } public string? Index { get; set; } - public System.Collections.Generic.ICollection? Routing { get; set; } + public string? Routing { get; set; } public double? Score { get; set; } public double? Score0 { get; set; } public TDocument? Source { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Esql/ESQLView.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Esql/ESQLView.Converters.g.cs new file mode 100644 index 00000000000..b09a10a4917 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Esql/ESQLView.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Esql.Json; + +public sealed partial class ESQLViewConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"u8); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"u8); + + public override Elastic.Clients.Elasticsearch.Esql.ESQLView Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + LocalJsonValue propQuery = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Esql.ESQLView(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value, + Query = propQuery.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.ESQLView value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RawDocument.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Esql/ESQLView.g.cs similarity index 71% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RawDocument.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Esql/ESQLView.g.cs index e8edc0a0513..87374d957a8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RawDocument.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Esql/ESQLView.g.cs @@ -21,39 +21,44 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.IndexManagement; +namespace Elastic.Clients.Elasticsearch.Esql; -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.RawDocumentConverter))] -public sealed partial class RawDocument +/// +/// +/// A non-materialized ES|QL view. +/// +/// +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.Json.ESQLViewConverter))] +public sealed partial class ESQLView { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public RawDocument(string index, Elastic.Clients.Elasticsearch.Mapping.Properties source) + public ESQLView(string name, string query) { - Index = index; - Source = source; + Name = name; + Query = query; } - public RawDocument() + public ESQLView() { } [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - internal RawDocument(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + internal ESQLView(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) { _ = sentinel; } /// /// - /// Name of the index for this raw document. + /// The name of the ES|QL view /// /// - public required string Index { get; set; } + public required string Name { get; set; } /// /// - /// The original raw source. + /// The ES|QL query /// /// - public required Elastic.Clients.Elasticsearch.Mapping.Properties Source { get; set; } + public required string Query { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AddAction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AddAction.Converters.g.cs index bfcd5b79fe3..50ddc1d29fa 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AddAction.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AddAction.Converters.g.cs @@ -44,13 +44,13 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.AddAction Read(ref LocalJsonValue?> propAliases = default; LocalJsonValue propFilter = default; LocalJsonValue propIndex = default; - LocalJsonValue propIndexRouting = default; + LocalJsonValue propIndexRouting = default; LocalJsonValue propIndices = default; LocalJsonValue propIsHidden = default; LocalJsonValue propIsWriteIndex = default; LocalJsonValue propMustExist = default; - LocalJsonValue propRouting = default; - LocalJsonValue propSearchRouting = default; + LocalJsonValue propRouting = default; + LocalJsonValue propSearchRouting = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propAlias.TryReadProperty(ref reader, options, PropAlias, null)) 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 7964e6a6468..1fdc2cb9d0f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AddAction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AddAction.g.cs @@ -74,7 +74,7 @@ internal AddAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSe /// Data stream aliases don’t support this parameter. /// /// - public Elastic.Clients.Elasticsearch.Routing? IndexRouting { get; set; } + public string? IndexRouting { get; set; } /// /// @@ -111,7 +111,7 @@ internal AddAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSe /// Data stream aliases don’t support this parameter. /// /// - public Elastic.Clients.Elasticsearch.Routing? Routing { get; set; } + public string? Routing { get; set; } /// /// @@ -120,7 +120,7 @@ internal AddAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSe /// Data stream aliases don’t support this parameter. /// /// - public Elastic.Clients.Elasticsearch.Routing? SearchRouting { get; set; } + public string? SearchRouting { get; set; } } public readonly partial struct AddActionDescriptor @@ -219,7 +219,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.AddActionDescriptor /// - public Elastic.Clients.Elasticsearch.IndexManagement.AddActionDescriptor IndexRouting(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.IndexManagement.AddActionDescriptor IndexRouting(string? value) { Instance.IndexRouting = value; return this; @@ -276,7 +276,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.AddActionDescriptor /// - public Elastic.Clients.Elasticsearch.IndexManagement.AddActionDescriptor Routing(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.IndexManagement.AddActionDescriptor Routing(string? value) { Instance.Routing = value; return this; @@ -289,7 +289,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.AddActionDescriptor /// - public Elastic.Clients.Elasticsearch.IndexManagement.AddActionDescriptor SearchRouting(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.IndexManagement.AddActionDescriptor SearchRouting(string? value) { Instance.SearchRouting = value; return this; @@ -416,7 +416,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.AddActionDescriptor Index(E /// Data stream aliases don’t support this parameter. /// /// - public Elastic.Clients.Elasticsearch.IndexManagement.AddActionDescriptor IndexRouting(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.IndexManagement.AddActionDescriptor IndexRouting(string? value) { Instance.IndexRouting = value; return this; @@ -473,7 +473,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.AddActionDescriptor MustExi /// Data stream aliases don’t support this parameter. /// /// - public Elastic.Clients.Elasticsearch.IndexManagement.AddActionDescriptor Routing(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.IndexManagement.AddActionDescriptor Routing(string? value) { Instance.Routing = value; return this; @@ -486,7 +486,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.AddActionDescriptor Routing /// Data stream aliases don’t support this parameter. /// /// - public Elastic.Clients.Elasticsearch.IndexManagement.AddActionDescriptor SearchRouting(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.IndexManagement.AddActionDescriptor SearchRouting(string? value) { Instance.SearchRouting = value; return this; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Alias.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Alias.Converters.g.cs index ca93fb032d4..cc6cd07cbe9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Alias.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Alias.Converters.g.cs @@ -36,11 +36,11 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.Alias Read(ref Sys { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propFilter = default; - LocalJsonValue propIndexRouting = default; + LocalJsonValue propIndexRouting = default; LocalJsonValue propIsHidden = default; LocalJsonValue propIsWriteIndex = default; - LocalJsonValue propRouting = default; - LocalJsonValue propSearchRouting = default; + LocalJsonValue propRouting = default; + LocalJsonValue propSearchRouting = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propFilter.TryReadProperty(ref reader, options, PropFilter, 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 9bcd9a58f59..73442093490 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Alias.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Alias.g.cs @@ -49,7 +49,7 @@ internal Alias(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentin /// If specified, this overwrites the routing value for indexing operations. /// /// - public Elastic.Clients.Elasticsearch.Routing? IndexRouting { get; set; } + public string? IndexRouting { get; set; } /// /// @@ -71,7 +71,7 @@ internal Alias(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentin /// Value used to route indexing and search operations to a specific shard. /// /// - public Elastic.Clients.Elasticsearch.Routing? Routing { get; set; } + public string? Routing { get; set; } /// /// @@ -79,7 +79,7 @@ internal Alias(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentin /// If specified, this overwrites the routing value for search operations. /// /// - public Elastic.Clients.Elasticsearch.Routing? SearchRouting { get; set; } + public string? SearchRouting { get; set; } } public readonly partial struct AliasDescriptor @@ -129,7 +129,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.AliasDescriptor /// If specified, this overwrites the routing value for indexing operations. /// /// - public Elastic.Clients.Elasticsearch.IndexManagement.AliasDescriptor IndexRouting(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.IndexManagement.AliasDescriptor IndexRouting(string? value) { Instance.IndexRouting = value; return this; @@ -163,7 +163,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.AliasDescriptor /// Value used to route indexing and search operations to a specific shard. /// /// - public Elastic.Clients.Elasticsearch.IndexManagement.AliasDescriptor Routing(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.IndexManagement.AliasDescriptor Routing(string? value) { Instance.Routing = value; return this; @@ -175,7 +175,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.AliasDescriptor /// If specified, this overwrites the routing value for search operations. /// /// - public Elastic.Clients.Elasticsearch.IndexManagement.AliasDescriptor SearchRouting(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.IndexManagement.AliasDescriptor SearchRouting(string? value) { Instance.SearchRouting = value; return this; @@ -253,7 +253,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.AliasDescriptor Filter(S /// If specified, this overwrites the routing value for indexing operations. /// /// - public Elastic.Clients.Elasticsearch.IndexManagement.AliasDescriptor IndexRouting(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.IndexManagement.AliasDescriptor IndexRouting(string? value) { Instance.IndexRouting = value; return this; @@ -287,7 +287,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.AliasDescriptor IsWriteInde /// Value used to route indexing and search operations to a specific shard. /// /// - public Elastic.Clients.Elasticsearch.IndexManagement.AliasDescriptor Routing(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.IndexManagement.AliasDescriptor Routing(string? value) { Instance.Routing = value; return this; @@ -299,7 +299,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.AliasDescriptor Routing(Ela /// If specified, this overwrites the routing value for search operations. /// /// - public Elastic.Clients.Elasticsearch.IndexManagement.AliasDescriptor SearchRouting(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.IndexManagement.AliasDescriptor SearchRouting(string? value) { Instance.SearchRouting = value; return this; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSamplingConfiguration.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSamplingConfiguration.g.cs deleted file mode 100644 index 8311a0cb8d5..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSamplingConfiguration.g.cs +++ /dev/null @@ -1,48 +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.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.IndexManagement; - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexSamplingConfigurationConverter))] -public sealed partial class IndexSamplingConfiguration -{ - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public IndexSamplingConfiguration(Elastic.Clients.Elasticsearch.IndexManagement.SamplingConfiguration configuration, string index) - { - Configuration = configuration; - Index = index; - } - - public IndexSamplingConfiguration() - { - } - - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - internal IndexSamplingConfiguration(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) - { - _ = sentinel; - } - - public required Elastic.Clients.Elasticsearch.IndexManagement.SamplingConfiguration Configuration { get; set; } - public required string Index { get; set; } -} \ No newline at end of file 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 69983b88638..f92a43897d2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplate.g.cs @@ -94,7 +94,7 @@ internal IndexTemplate(Elastic.Clients.Elasticsearch.Serialization.JsonConstruct /// /// - /// Name of the index template. + /// Array of wildcard (*) expressions used to match the names of data streams and indices during creation. /// /// public required Elastic.Clients.Elasticsearch.Names IndexPatterns { get; set; } @@ -284,7 +284,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDescriptor /// - /// Name of the index template. + /// Array of wildcard (*) expressions used to match the names of data streams and indices during creation. /// /// public Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDescriptor IndexPatterns(Elastic.Clients.Elasticsearch.Names value) @@ -565,7 +565,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDescriptor Ign /// /// - /// Name of the index template. + /// Array of wildcard (*) expressions used to match the names of data streams and indices during creation. /// /// public Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDescriptor IndexPatterns(Elastic.Clients.Elasticsearch.Names value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesValidationExplanation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesValidationExplanation.Converters.g.cs index aee04ca00a0..efdf2d61db0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesValidationExplanation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesValidationExplanation.Converters.g.cs @@ -28,6 +28,7 @@ public sealed partial class IndicesValidationExplanationConverter : System.Text. private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"u8); private static readonly System.Text.Json.JsonEncodedText PropExplanation = System.Text.Json.JsonEncodedText.Encode("explanation"u8); private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"u8); + private static readonly System.Text.Json.JsonEncodedText PropShard = System.Text.Json.JsonEncodedText.Encode("shard"u8); private static readonly System.Text.Json.JsonEncodedText PropValid = System.Text.Json.JsonEncodedText.Encode("valid"u8); public override Elastic.Clients.Elasticsearch.IndexManagement.IndicesValidationExplanation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) @@ -35,7 +36,8 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.IndicesValidationE reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propError = default; LocalJsonValue propExplanation = default; - LocalJsonValue propIndex = default; + LocalJsonValue propIndex = default; + LocalJsonValue propShard = default; LocalJsonValue propValid = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -54,6 +56,11 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.IndicesValidationE continue; } + if (propShard.TryReadProperty(ref reader, options, PropShard, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + if (propValid.TryReadProperty(ref reader, options, PropValid, null)) { continue; @@ -74,6 +81,7 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.IndicesValidationE Error = propError.Value, Explanation = propExplanation.Value, Index = propIndex.Value, + Shard = propShard.Value, Valid = propValid.Value }; } @@ -84,6 +92,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropError, value.Error, null, null); writer.WriteProperty(options, PropExplanation, value.Explanation, null, null); writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropShard, value.Shard, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropValid, value.Valid, null, null); writer.WriteEndObject(); } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesValidationExplanation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesValidationExplanation.g.cs index b7a2512cc1a..9b2693fe31e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesValidationExplanation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesValidationExplanation.g.cs @@ -27,9 +27,8 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; public sealed partial class IndicesValidationExplanation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public IndicesValidationExplanation(string index, bool valid) + public IndicesValidationExplanation(bool valid) { - Index = index; Valid = valid; } @@ -45,6 +44,7 @@ internal IndicesValidationExplanation(Elastic.Clients.Elasticsearch.Serializatio public string? Error { get; set; } public string? Explanation { get; set; } - public required string Index { get; set; } + public string? Index { get; set; } + public int? Shard { get; set; } public required bool Valid { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SamplingConfiguration.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SamplingConfiguration.Converters.g.cs deleted file mode 100644 index 00fa6eccdd5..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SamplingConfiguration.Converters.g.cs +++ /dev/null @@ -1,135 +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.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; - -public sealed partial class SamplingConfigurationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCreationTime = System.Text.Json.JsonEncodedText.Encode("creation_time"u8); - private static readonly System.Text.Json.JsonEncodedText PropCreationTimeInMillis = System.Text.Json.JsonEncodedText.Encode("creation_time_in_millis"u8); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"u8); - private static readonly System.Text.Json.JsonEncodedText PropMaxSamples = System.Text.Json.JsonEncodedText.Encode("max_samples"u8); - private static readonly System.Text.Json.JsonEncodedText PropMaxSize = System.Text.Json.JsonEncodedText.Encode("max_size"u8); - private static readonly System.Text.Json.JsonEncodedText PropMaxSizeInBytes = System.Text.Json.JsonEncodedText.Encode("max_size_in_bytes"u8); - private static readonly System.Text.Json.JsonEncodedText PropRate = System.Text.Json.JsonEncodedText.Encode("rate"u8); - private static readonly System.Text.Json.JsonEncodedText PropTimeToLive = System.Text.Json.JsonEncodedText.Encode("time_to_live"u8); - private static readonly System.Text.Json.JsonEncodedText PropTimeToLiveInMillis = System.Text.Json.JsonEncodedText.Encode("time_to_live_in_millis"u8); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SamplingConfiguration Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCreationTime = default; - LocalJsonValue propCreationTimeInMillis = default; - LocalJsonValue propIf = default; - LocalJsonValue propMaxSamples = default; - LocalJsonValue propMaxSize = default; - LocalJsonValue propMaxSizeInBytes = default; - LocalJsonValue propRate = default; - LocalJsonValue propTimeToLive = default; - LocalJsonValue propTimeToLiveInMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCreationTime.TryReadProperty(ref reader, options, PropCreationTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propCreationTimeInMillis.TryReadProperty(ref reader, options, PropCreationTimeInMillis, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propMaxSamples.TryReadProperty(ref reader, options, PropMaxSamples, null)) - { - continue; - } - - if (propMaxSize.TryReadProperty(ref reader, options, PropMaxSize, null)) - { - continue; - } - - if (propMaxSizeInBytes.TryReadProperty(ref reader, options, PropMaxSizeInBytes, null)) - { - continue; - } - - if (propRate.TryReadProperty(ref reader, options, PropRate, null)) - { - continue; - } - - if (propTimeToLive.TryReadProperty(ref reader, options, PropTimeToLive, null)) - { - continue; - } - - if (propTimeToLiveInMillis.TryReadProperty(ref reader, options, PropTimeToLiveInMillis, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.SafeSkip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SamplingConfiguration(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CreationTime = propCreationTime.Value, - CreationTimeInMillis = propCreationTimeInMillis.Value, - If = propIf.Value, - MaxSamples = propMaxSamples.Value, - MaxSize = propMaxSize.Value, - MaxSizeInBytes = propMaxSizeInBytes.Value, - Rate = propRate.Value, - TimeToLive = propTimeToLive.Value, - TimeToLiveInMillis = propTimeToLiveInMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SamplingConfiguration value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCreationTime, value.CreationTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropCreationTimeInMillis, value.CreationTimeInMillis, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropMaxSamples, value.MaxSamples, null, null); - writer.WriteProperty(options, PropMaxSize, value.MaxSize, null, null); - writer.WriteProperty(options, PropMaxSizeInBytes, value.MaxSizeInBytes, null, null); - writer.WriteProperty(options, PropRate, value.Rate, null, null); - writer.WriteProperty(options, PropTimeToLive, value.TimeToLive, null, null); - writer.WriteProperty(options, PropTimeToLiveInMillis, value.TimeToLiveInMillis, null, null); - writer.WriteEndObject(); - } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SamplingConfiguration.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SamplingConfiguration.g.cs deleted file mode 100644 index 283d14f6c62..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SamplingConfiguration.g.cs +++ /dev/null @@ -1,116 +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.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.IndexManagement; - -/// -/// -/// Sampling configuration as returned by the API. -/// -/// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SamplingConfigurationConverter))] -public sealed partial class SamplingConfiguration -{ - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public SamplingConfiguration(long creationTimeInMillis, int maxSamples, long maxSizeInBytes, double rate, long timeToLiveInMillis) - { - CreationTimeInMillis = creationTimeInMillis; - MaxSamples = maxSamples; - MaxSizeInBytes = maxSizeInBytes; - Rate = rate; - TimeToLiveInMillis = timeToLiveInMillis; - } - - public SamplingConfiguration() - { - } - - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - internal SamplingConfiguration(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) - { - _ = sentinel; - } - - /// - /// - /// The time when the sampling configuration was created. - /// - /// - public System.DateTimeOffset? CreationTime { get; set; } - - /// - /// - /// The time when the sampling configuration was created, in milliseconds since epoch. - /// - /// - public required long CreationTimeInMillis { get; set; } - - /// - /// - /// An optional condition script that sampled documents must satisfy. - /// - /// - public string? If { get; set; } - - /// - /// - /// The maximum number of documents to sample. - /// - /// - public required int MaxSamples { get; set; } - - /// - /// - /// The maximum total size of sampled documents. - /// - /// - public Elastic.Clients.Elasticsearch.ByteSize? MaxSize { get; set; } - - /// - /// - /// The maximum total size of sampled documents in bytes. - /// - /// - public required long MaxSizeInBytes { get; set; } - - /// - /// - /// The fraction of documents to sample between 0 and 1. - /// - /// - public required double Rate { get; set; } - - /// - /// - /// The duration for which the sampled documents should be retained. - /// - /// - public Elastic.Clients.Elasticsearch.Duration? TimeToLive { get; set; } - - /// - /// - /// The duration for which the sampled documents should be retained, in milliseconds. - /// - /// - public required long TimeToLiveInMillis { get; set; } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Ai21ServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Ai21ServiceSettings.g.cs index 1a8d77c74e0..d641401051a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Ai21ServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Ai21ServiceSettings.g.cs @@ -49,8 +49,6 @@ internal Ai21ServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonCon /// /// IMPORTANT: You need to provide the API key only once, during the inference model creation. /// The get inference endpoint API does not retrieve your API key. - /// After creating the inference model, you cannot change the associated API key. - /// If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. /// /// public string? ApiKey { get; set; } @@ -111,8 +109,6 @@ public Ai21ServiceSettingsDescriptor() /// /// IMPORTANT: You need to provide the API key only once, during the inference model creation. /// The get inference endpoint API does not retrieve your API key. - /// After creating the inference model, you cannot change the associated API key. - /// If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. /// /// public Elastic.Clients.Elasticsearch.Inference.Ai21ServiceSettingsDescriptor ApiKey(string? value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockServiceSettings.g.cs index 49d97c5d571..6128c76feb8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockServiceSettings.g.cs @@ -75,27 +75,27 @@ internal AmazonBedrockServiceSettings(Elastic.Clients.Elasticsearch.Serializatio /// /// /// - /// anthropic - available for completion task type only + /// anthropic - available for chat_completion and completion task types /// /// /// /// - /// ai21labs - available for completion task type only + /// ai21labs - available for chat_completion and completion task types /// /// /// /// - /// cohere - available for text_embedding and completion task types + /// cohere - available for chat_completion, completion and text_embedding task types /// /// /// /// - /// meta - available for completion task type only + /// meta - available for chat_completion and completion task types /// /// /// /// - /// mistral - available for completion task type only + /// mistral - available for chat_completion and completion task types /// /// /// @@ -104,8 +104,8 @@ internal AmazonBedrockServiceSettings(Elastic.Clients.Elasticsearch.Serializatio /// /// - /// This setting helps to minimize the number of rate limit errors returned from Watsonx. - /// By default, the watsonxai service sets the number of requests allowed per minute to 120. + /// This setting helps to minimize the number of rate limit errors returned from Amazon Bedrock. + /// By default, the amazonbedrock service sets the number of requests allowed per minute to 240. /// /// public Elastic.Clients.Elasticsearch.Inference.RateLimitSetting? RateLimit { get; set; } @@ -184,27 +184,27 @@ public Elastic.Clients.Elasticsearch.Inference.AmazonBedrockServiceSettingsDescr /// /// /// - /// anthropic - available for completion task type only + /// anthropic - available for chat_completion and completion task types /// /// /// /// - /// ai21labs - available for completion task type only + /// ai21labs - available for chat_completion and completion task types /// /// /// /// - /// cohere - available for text_embedding and completion task types + /// cohere - available for chat_completion, completion and text_embedding task types /// /// /// /// - /// meta - available for completion task type only + /// meta - available for chat_completion and completion task types /// /// /// /// - /// mistral - available for completion task type only + /// mistral - available for chat_completion and completion task types /// /// /// @@ -217,8 +217,8 @@ public Elastic.Clients.Elasticsearch.Inference.AmazonBedrockServiceSettingsDescr /// /// - /// This setting helps to minimize the number of rate limit errors returned from Watsonx. - /// By default, the watsonxai service sets the number of requests allowed per minute to 120. + /// This setting helps to minimize the number of rate limit errors returned from Amazon Bedrock. + /// By default, the amazonbedrock service sets the number of requests allowed per minute to 240. /// /// public Elastic.Clients.Elasticsearch.Inference.AmazonBedrockServiceSettingsDescriptor RateLimit(Elastic.Clients.Elasticsearch.Inference.RateLimitSetting? value) @@ -229,8 +229,8 @@ public Elastic.Clients.Elasticsearch.Inference.AmazonBedrockServiceSettingsDescr /// /// - /// This setting helps to minimize the number of rate limit errors returned from Watsonx. - /// By default, the watsonxai service sets the number of requests allowed per minute to 120. + /// This setting helps to minimize the number of rate limit errors returned from Amazon Bedrock. + /// By default, the amazonbedrock service sets the number of requests allowed per minute to 240. /// /// public Elastic.Clients.Elasticsearch.Inference.AmazonBedrockServiceSettingsDescriptor RateLimit() @@ -241,8 +241,8 @@ public Elastic.Clients.Elasticsearch.Inference.AmazonBedrockServiceSettingsDescr /// /// - /// This setting helps to minimize the number of rate limit errors returned from Watsonx. - /// By default, the watsonxai service sets the number of requests allowed per minute to 120. + /// This setting helps to minimize the number of rate limit errors returned from Amazon Bedrock. + /// By default, the amazonbedrock service sets the number of requests allowed per minute to 240. /// /// public Elastic.Clients.Elasticsearch.Inference.AmazonBedrockServiceSettingsDescriptor RateLimit(System.Action? action) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockTaskSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockTaskSettings.g.cs index 741d364e21a..4779488fc71 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockTaskSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockTaskSettings.g.cs @@ -38,14 +38,14 @@ internal AmazonBedrockTaskSettings(Elastic.Clients.Elasticsearch.Serialization.J /// /// - /// For a completion task, it sets the maximum number for the output tokens to be generated. + /// For chat_completion and completion tasks, it sets the maximum number for the output tokens to be generated. /// /// public int? MaxNewTokens { get; set; } /// /// - /// For a completion task, it is a number between 0.0 and 1.0 that controls the apparent creativity of the results. + /// For chat_completion and completion tasks, it is a number between 0.0 and 1.0 that controls the apparent creativity of the results. /// At temperature 0.0 the model is most deterministic, at temperature 1.0 most random. /// It should not be used if top_p or top_k is specified. /// @@ -54,7 +54,7 @@ internal AmazonBedrockTaskSettings(Elastic.Clients.Elasticsearch.Serialization.J /// /// - /// For a completion task, it limits samples to the top-K most likely words, balancing coherence and variability. + /// For chat_completion and completion tasks, it limits samples to the top-K most likely words, balancing coherence and variability. /// It is only available for anthropic, cohere, and mistral providers. /// It is an alternative to temperature; it should not be used if temperature is specified. /// @@ -63,7 +63,7 @@ internal AmazonBedrockTaskSettings(Elastic.Clients.Elasticsearch.Serialization.J /// /// - /// For a completion task, it is a number in the range of 0.0 to 1.0, to eliminate low-probability tokens. + /// For chat_completion and completion tasks, it is a number in the range of 0.0 to 1.0, to eliminate low-probability tokens. /// Top-p uses nucleus sampling to select top tokens whose sum of likelihoods does not exceed a certain value, ensuring both variety and coherence. /// It is an alternative to temperature; it should not be used if temperature is specified. /// @@ -92,7 +92,7 @@ public AmazonBedrockTaskSettingsDescriptor() /// /// - /// For a completion task, it sets the maximum number for the output tokens to be generated. + /// For chat_completion and completion tasks, it sets the maximum number for the output tokens to be generated. /// /// public Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskSettingsDescriptor MaxNewTokens(int? value) @@ -103,7 +103,7 @@ public Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskSettingsDescript /// /// - /// For a completion task, it is a number between 0.0 and 1.0 that controls the apparent creativity of the results. + /// For chat_completion and completion tasks, it is a number between 0.0 and 1.0 that controls the apparent creativity of the results. /// At temperature 0.0 the model is most deterministic, at temperature 1.0 most random. /// It should not be used if top_p or top_k is specified. /// @@ -116,7 +116,7 @@ public Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskSettingsDescript /// /// - /// For a completion task, it limits samples to the top-K most likely words, balancing coherence and variability. + /// For chat_completion and completion tasks, it limits samples to the top-K most likely words, balancing coherence and variability. /// It is only available for anthropic, cohere, and mistral providers. /// It is an alternative to temperature; it should not be used if temperature is specified. /// @@ -129,7 +129,7 @@ public Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskSettingsDescript /// /// - /// For a completion task, it is a number in the range of 0.0 to 1.0, to eliminate low-probability tokens. + /// For chat_completion and completion tasks, it is a number in the range of 0.0 to 1.0, to eliminate low-probability tokens. /// Top-p uses nucleus sampling to select top tokens whose sum of likelihoods does not exceed a certain value, ensuring both variety and coherence. /// It is an alternative to temperature; it should not be used if temperature is specified. /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockTaskType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockTaskType.Converters.g.cs index be9f97e6952..923432db70c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockTaskType.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockTaskType.Converters.g.cs @@ -25,11 +25,17 @@ namespace Elastic.Clients.Elasticsearch.Inference.Json; public sealed partial class AmazonBedrockTaskTypeConverter : System.Text.Json.Serialization.JsonConverter { + private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"u8); private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"u8); private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"u8); public override Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { + if (reader.ValueTextEquals(MemberChatCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType.ChatCompletion; + } + if (reader.ValueTextEquals(MemberCompletion)) { return Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType.Completion; @@ -41,6 +47,11 @@ public override Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType Re } var value = reader.GetString()!; + if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType.ChatCompletion; + } + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) { return Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType.Completion; @@ -58,6 +69,9 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { switch (value) { + case Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType.ChatCompletion: + writer.WriteStringValue(MemberChatCompletion); + break; case Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType.Completion: writer.WriteStringValue(MemberCompletion); break; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockTaskType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockTaskType.g.cs index d12806761ed..2b5275d8f77 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockTaskType.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockTaskType.g.cs @@ -26,6 +26,8 @@ namespace Elastic.Clients.Elasticsearch.Inference; [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.AmazonBedrockTaskTypeConverter))] public enum AmazonBedrockTaskType { + [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] + ChatCompletion, [System.Runtime.Serialization.EnumMember(Value = "completion")] Completion, [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureAiStudioServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureAiStudioServiceSettings.g.cs index 361f23fa1be..6f2344c4ac9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureAiStudioServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureAiStudioServiceSettings.g.cs @@ -53,8 +53,6 @@ internal AzureAiStudioServiceSettings(Elastic.Clients.Elasticsearch.Serializatio /// /// IMPORTANT: You need to provide the API key only once, during the inference model creation. /// The get inference endpoint API does not retrieve your API key. - /// After creating the inference model, you cannot change the associated API key. - /// If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. /// /// public required string ApiKey { get; set; } @@ -153,8 +151,6 @@ public AzureAiStudioServiceSettingsDescriptor() /// /// IMPORTANT: You need to provide the API key only once, during the inference model creation. /// The get inference endpoint API does not retrieve your API key. - /// After creating the inference model, you cannot change the associated API key. - /// If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. /// /// public Elastic.Clients.Elasticsearch.Inference.AzureAiStudioServiceSettingsDescriptor ApiKey(string value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAIServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAIServiceSettings.g.cs index 3076e1840a2..025c93c08c8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAIServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAIServiceSettings.g.cs @@ -53,8 +53,6 @@ internal AzureOpenAIServiceSettings(Elastic.Clients.Elasticsearch.Serialization. /// /// IMPORTANT: You need to provide the API key only once, during the inference model creation. /// The get inference endpoint API does not retrieve your API key. - /// After creating the inference model, you cannot change the associated API key. - /// If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. /// /// public string? ApiKey { get; set; } @@ -131,8 +129,6 @@ public AzureOpenAiServiceSettingsDescriptor() /// /// IMPORTANT: You need to provide the API key only once, during the inference model creation. /// The get inference endpoint API does not retrieve your API key. - /// After creating the inference model, you cannot change the associated API key. - /// If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. /// /// public Elastic.Clients.Elasticsearch.Inference.AzureOpenAiServiceSettingsDescriptor ApiKey(string? value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereServiceSettings.g.cs index 5c4337bec6e..eff7329e680 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereServiceSettings.g.cs @@ -51,8 +51,6 @@ internal CohereServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonC /// /// IMPORTANT: You need to provide the API key only once, during the inference model creation. /// The get inference endpoint API does not retrieve your API key. - /// After creating the inference model, you cannot change the associated API key. - /// If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. /// /// public required string ApiKey { get; set; } @@ -138,8 +136,6 @@ public CohereServiceSettingsDescriptor() /// /// IMPORTANT: You need to provide the API key only once, during the inference model creation. /// The get inference endpoint API does not retrieve your API key. - /// After creating the inference model, you cannot change the associated API key. - /// If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. /// /// public Elastic.Clients.Elasticsearch.Inference.CohereServiceSettingsDescriptor ApiKey(string value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContextualAIServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContextualAIServiceSettings.g.cs index d79dfba12cd..dbbbcbb22e9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContextualAIServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContextualAIServiceSettings.g.cs @@ -50,8 +50,6 @@ internal ContextualAIServiceSettings(Elastic.Clients.Elasticsearch.Serialization /// /// IMPORTANT: You need to provide the API key only once, during the inference model creation. /// The get inference endpoint API does not retrieve your API key. - /// After creating the inference model, you cannot change the associated API key. - /// If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. /// /// public required string ApiKey { get; set; } @@ -100,8 +98,6 @@ public ContextualAiServiceSettingsDescriptor() /// /// IMPORTANT: You need to provide the API key only once, during the inference model creation. /// The get inference endpoint API does not retrieve your API key. - /// After creating the inference model, you cannot change the associated API key. - /// If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. /// /// public Elastic.Clients.Elasticsearch.Inference.ContextualAiServiceSettingsDescriptor ApiKey(string value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/DeepSeekServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/DeepSeekServiceSettings.g.cs index 0b43e6d18e7..c7c16d9e614 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/DeepSeekServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/DeepSeekServiceSettings.g.cs @@ -51,8 +51,6 @@ internal DeepSeekServiceSettings(Elastic.Clients.Elasticsearch.Serialization.Jso /// /// IMPORTANT: You need to provide the API key only once, during the inference model creation. /// The get inference endpoint API does not retrieve your API key. - /// After creating the inference model, you cannot change the associated API key. - /// If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. /// /// public required string ApiKey { get; set; } @@ -102,8 +100,6 @@ public DeepSeekServiceSettingsDescriptor() /// /// IMPORTANT: You need to provide the API key only once, during the inference model creation. /// The get inference endpoint API does not retrieve your API key. - /// After creating the inference model, you cannot change the associated API key. - /// If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. /// /// public Elastic.Clients.Elasticsearch.Inference.DeepSeekServiceSettingsDescriptor ApiKey(string value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingByteResult.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/DenseEmbeddingByteResult.Converters.g.cs similarity index 80% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingByteResult.Converters.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/DenseEmbeddingByteResult.Converters.g.cs index 4b3f3dc0a74..e46ebf0881d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingByteResult.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/DenseEmbeddingByteResult.Converters.g.cs @@ -23,11 +23,11 @@ namespace Elastic.Clients.Elasticsearch.Inference.Json; -public sealed partial class TextEmbeddingByteResultConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class DenseEmbeddingByteResultConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropEmbedding = System.Text.Json.JsonEncodedText.Encode("embedding"u8); - public override Elastic.Clients.Elasticsearch.Inference.TextEmbeddingByteResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + public override Elastic.Clients.Elasticsearch.Inference.DenseEmbeddingByteResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue> propEmbedding = default; @@ -48,13 +48,13 @@ public override Elastic.Clients.Elasticsearch.Inference.TextEmbeddingByteResult } reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.TextEmbeddingByteResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + return new Elastic.Clients.Elasticsearch.Inference.DenseEmbeddingByteResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Embedding = propEmbedding.Value }; } - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TextEmbeddingByteResult value, System.Text.Json.JsonSerializerOptions options) + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.DenseEmbeddingByteResult value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); writer.WriteProperty(options, PropEmbedding, value.Embedding, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingByteResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/DenseEmbeddingByteResult.g.cs similarity index 79% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingByteResult.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/DenseEmbeddingByteResult.g.cs index 5466945ff70..b45b5eceb74 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingByteResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/DenseEmbeddingByteResult.g.cs @@ -25,24 +25,24 @@ namespace Elastic.Clients.Elasticsearch.Inference; /// /// -/// The text embedding result object for byte representation +/// The dense embedding result object for byte representation /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TextEmbeddingByteResultConverter))] -public sealed partial class TextEmbeddingByteResult +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.DenseEmbeddingByteResultConverter))] +public sealed partial class DenseEmbeddingByteResult { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public TextEmbeddingByteResult(System.Collections.Generic.IReadOnlyCollection embedding) + public DenseEmbeddingByteResult(System.Collections.Generic.IReadOnlyCollection embedding) { Embedding = embedding; } - public TextEmbeddingByteResult() + public DenseEmbeddingByteResult() { } [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - internal TextEmbeddingByteResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + internal DenseEmbeddingByteResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) { _ = sentinel; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingResult.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/DenseEmbeddingResult.Converters.g.cs similarity index 81% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingResult.Converters.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/DenseEmbeddingResult.Converters.g.cs index 89bd5af5f68..fdfed3da4e5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingResult.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/DenseEmbeddingResult.Converters.g.cs @@ -23,11 +23,11 @@ namespace Elastic.Clients.Elasticsearch.Inference.Json; -public sealed partial class TextEmbeddingResultConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class DenseEmbeddingResultConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropEmbedding = System.Text.Json.JsonEncodedText.Encode("embedding"u8); - public override Elastic.Clients.Elasticsearch.Inference.TextEmbeddingResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + public override Elastic.Clients.Elasticsearch.Inference.DenseEmbeddingResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue> propEmbedding = default; @@ -48,13 +48,13 @@ public override Elastic.Clients.Elasticsearch.Inference.TextEmbeddingResult Read } reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.TextEmbeddingResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + return new Elastic.Clients.Elasticsearch.Inference.DenseEmbeddingResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Embedding = propEmbedding.Value }; } - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TextEmbeddingResult value, System.Text.Json.JsonSerializerOptions options) + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.DenseEmbeddingResult value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); writer.WriteProperty(options, PropEmbedding, value.Embedding, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/DenseEmbeddingResult.g.cs similarity index 80% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingResult.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/DenseEmbeddingResult.g.cs index d237c6e745b..68d4d1fb091 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/DenseEmbeddingResult.g.cs @@ -25,24 +25,24 @@ namespace Elastic.Clients.Elasticsearch.Inference; /// /// -/// The text embedding result object +/// The dense embedding result object for float representation /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TextEmbeddingResultConverter))] -public sealed partial class TextEmbeddingResult +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.DenseEmbeddingResultConverter))] +public sealed partial class DenseEmbeddingResult { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public TextEmbeddingResult(System.Collections.Generic.IReadOnlyCollection embedding) + public DenseEmbeddingResult(System.Collections.Generic.IReadOnlyCollection embedding) { Embedding = embedding; } - public TextEmbeddingResult() + public DenseEmbeddingResult() { } [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - internal TextEmbeddingResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + internal DenseEmbeddingResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) { _ = sentinel; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingContentFormat.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingContentFormat.Converters.g.cs new file mode 100644 index 00000000000..42cbfd3239a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingContentFormat.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class EmbeddingContentFormatConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberBase64 = System.Text.Json.JsonEncodedText.Encode("base64"u8); + private static readonly System.Text.Json.JsonEncodedText MemberText = System.Text.Json.JsonEncodedText.Encode("text"u8); + + public override Elastic.Clients.Elasticsearch.Inference.EmbeddingContentFormat Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberBase64)) + { + return Elastic.Clients.Elasticsearch.Inference.EmbeddingContentFormat.Base64; + } + + if (reader.ValueTextEquals(MemberText)) + { + return Elastic.Clients.Elasticsearch.Inference.EmbeddingContentFormat.Text; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberBase64.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.EmbeddingContentFormat.Base64; + } + + if (string.Equals(value, MemberText.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.EmbeddingContentFormat.Text; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.EmbeddingContentFormat)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.EmbeddingContentFormat value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.EmbeddingContentFormat.Base64: + writer.WriteStringValue(MemberBase64); + break; + case Elastic.Clients.Elasticsearch.Inference.EmbeddingContentFormat.Text: + writer.WriteStringValue(MemberText); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.EmbeddingContentFormat)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.EmbeddingContentFormat ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.EmbeddingContentFormat value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingContentFormat.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingContentFormat.g.cs new file mode 100644 index 00000000000..c3f5fd419b4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingContentFormat.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.EmbeddingContentFormatConverter))] +public enum EmbeddingContentFormat +{ + [System.Runtime.Serialization.EnumMember(Value = "base64")] + Base64, + [System.Runtime.Serialization.EnumMember(Value = "text")] + Text +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingContentObject.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingContentObject.Converters.g.cs new file mode 100644 index 00000000000..061c256df91 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingContentObject.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class EmbeddingContentObjectConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropContent = System.Text.Json.JsonEncodedText.Encode("content"u8); + + public override Elastic.Clients.Elasticsearch.Inference.EmbeddingContentObject Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propContent = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propContent.TryReadProperty(ref reader, options, PropContent, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.EmbeddingContentObject(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Content = propContent.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.EmbeddingContentObject value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropContent, value.Content, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingContentObject.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingContentObject.g.cs new file mode 100644 index 00000000000..6b1ee30cfb4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingContentObject.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +/// +/// +/// A wrapper object which contains the fields required to specify multimodal inputs +/// +/// +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.EmbeddingContentObjectConverter))] +public sealed partial class EmbeddingContentObject +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public EmbeddingContentObject(Elastic.Clients.Elasticsearch.Inference.EmbeddingContentObjectContents content) + { + Content = content; + } + + public EmbeddingContentObject() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal EmbeddingContentObject(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// An object containing the input data for the model to embed + /// + /// + public required Elastic.Clients.Elasticsearch.Inference.EmbeddingContentObjectContents Content { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingContentObjectContents.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingContentObjectContents.Converters.g.cs new file mode 100644 index 00000000000..b4e978e1aab --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingContentObjectContents.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class EmbeddingContentObjectContentsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"u8); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"u8); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"u8); + + public override Elastic.Clients.Elasticsearch.Inference.EmbeddingContentObjectContents Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFormat = default; + LocalJsonValue propType = default; + LocalJsonValue propValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFormat.TryReadProperty(ref reader, options, PropFormat, static Elastic.Clients.Elasticsearch.Inference.EmbeddingContentFormat? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.EmbeddingContentObjectContents(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Format = propFormat.Value, + Type = propType.Value, + Value = propValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.EmbeddingContentObjectContents value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFormat, value.Format, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Inference.EmbeddingContentFormat? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropValue, value.Value, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingContentObjectContents.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingContentObjectContents.g.cs new file mode 100644 index 00000000000..e03e9eaf3ea --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingContentObjectContents.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +/// +/// +/// An object containing the input data for the model to embed. +/// +/// +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.EmbeddingContentObjectContentsConverter))] +public sealed partial class EmbeddingContentObjectContents +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public EmbeddingContentObjectContents(Elastic.Clients.Elasticsearch.Inference.EmbeddingContentType type, string value) + { + Type = type; + Value = value; + } + + public EmbeddingContentObjectContents() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal EmbeddingContentObjectContents(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// The format of the input. For the text type this defaults to text. For the image type, this defaults to base64. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.EmbeddingContentFormat? Format { get; set; } + + /// + /// + /// The type of input to embed. + /// + /// + public required Elastic.Clients.Elasticsearch.Inference.EmbeddingContentType Type { get; set; } + + /// + /// + /// The value of the input to embed. + /// + /// + public required string Value { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingContentType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingContentType.Converters.g.cs new file mode 100644 index 00000000000..fc34eb47ebc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingContentType.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class EmbeddingContentTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberImage = System.Text.Json.JsonEncodedText.Encode("image"u8); + private static readonly System.Text.Json.JsonEncodedText MemberText = System.Text.Json.JsonEncodedText.Encode("text"u8); + + public override Elastic.Clients.Elasticsearch.Inference.EmbeddingContentType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberImage)) + { + return Elastic.Clients.Elasticsearch.Inference.EmbeddingContentType.Image; + } + + if (reader.ValueTextEquals(MemberText)) + { + return Elastic.Clients.Elasticsearch.Inference.EmbeddingContentType.Text; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberImage.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.EmbeddingContentType.Image; + } + + if (string.Equals(value, MemberText.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.EmbeddingContentType.Text; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.EmbeddingContentType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.EmbeddingContentType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.EmbeddingContentType.Image: + writer.WriteStringValue(MemberImage); + break; + case Elastic.Clients.Elasticsearch.Inference.EmbeddingContentType.Text: + writer.WriteStringValue(MemberText); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.EmbeddingContentType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.EmbeddingContentType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.EmbeddingContentType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingContentType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingContentType.g.cs new file mode 100644 index 00000000000..8928917e4c0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingContentType.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.EmbeddingContentTypeConverter))] +public enum EmbeddingContentType +{ + [System.Runtime.Serialization.EnumMember(Value = "image")] + Image, + [System.Runtime.Serialization.EnumMember(Value = "text")] + Text +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingInferenceResult.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingInferenceResult.Converters.g.cs new file mode 100644 index 00000000000..ff19ba054db --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingInferenceResult.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class EmbeddingInferenceResultConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantEmbeddings = System.Text.Json.JsonEncodedText.Encode("embeddings"); + private static readonly System.Text.Json.JsonEncodedText VariantEmbeddingsBits = System.Text.Json.JsonEncodedText.Encode("embeddings_bits"); + private static readonly System.Text.Json.JsonEncodedText VariantEmbeddingsBytes = System.Text.Json.JsonEncodedText.Encode("embeddings_bytes"); + + public override Elastic.Clients.Elasticsearch.Inference.EmbeddingInferenceResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantEmbeddings)) + { + variantType = VariantEmbeddings.Value; + reader.Read(); + variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); + continue; + } + + if (reader.ValueTextEquals(VariantEmbeddingsBits)) + { + variantType = VariantEmbeddingsBits.Value; + reader.Read(); + variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); + continue; + } + + if (reader.ValueTextEquals(VariantEmbeddingsBytes)) + { + variantType = VariantEmbeddingsBytes.Value; + reader.Read(); + variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.EmbeddingInferenceResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.EmbeddingInferenceResult value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "embeddings": + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + break; + case "embeddings_bits": + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + break; + case "embeddings_bytes": + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Inference.EmbeddingInferenceResult)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingInferenceResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingInferenceResult.g.cs new file mode 100644 index 00000000000..ba6f0809464 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EmbeddingInferenceResult.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.EmbeddingInferenceResultConverter))] +public sealed partial class EmbeddingInferenceResult +{ + internal string? VariantType { get; set; } + internal object? Variant { get; set; } + + public EmbeddingInferenceResult() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal EmbeddingInferenceResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public System.Collections.Generic.IReadOnlyCollection? Embeddings { get => GetVariant>("embeddings"); set => SetVariant("embeddings", value); } + public System.Collections.Generic.IReadOnlyCollection? EmbeddingsBits { get => GetVariant>("embeddings_bits"); set => SetVariant("embeddings_bits", value); } + public System.Collections.Generic.IReadOnlyCollection? EmbeddingsBytes { get => GetVariant>("embeddings_bytes"); set => SetVariant("embeddings_bytes", value); } + + public static implicit operator Elastic.Clients.Elasticsearch.Inference.EmbeddingInferenceResult(Elastic.Clients.Elasticsearch.Inference.DenseEmbeddingResult[] value) => new Elastic.Clients.Elasticsearch.Inference.EmbeddingInferenceResult { Embeddings = value }; + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private T? GetVariant(string type) + { + if (string.Equals(VariantType, type, System.StringComparison.Ordinal) && Variant is T result) + { + return result; + } + + return default; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private void SetVariant(string type, T? value) + { + VariantType = type; + Variant = value; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAIServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAIServiceSettings.Converters.g.cs new file mode 100644 index 00000000000..c3c91cd2123 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAIServiceSettings.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class FireworksAIServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"u8); + private static readonly System.Text.Json.JsonEncodedText PropDimensions = System.Text.Json.JsonEncodedText.Encode("dimensions"u8); + private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"u8); + private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"u8); + private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"u8); + private static readonly System.Text.Json.JsonEncodedText PropUrl = System.Text.Json.JsonEncodedText.Encode("url"u8); + + public override Elastic.Clients.Elasticsearch.Inference.FireworksAIServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApiKey = default; + LocalJsonValue propDimensions = default; + LocalJsonValue propModelId = default; + LocalJsonValue propRateLimit = default; + LocalJsonValue propSimilarity = default; + LocalJsonValue propUrl = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) + { + continue; + } + + if (propDimensions.TryReadProperty(ref reader, options, PropDimensions, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) + { + continue; + } + + if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) + { + continue; + } + + if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, static Elastic.Clients.Elasticsearch.Inference.FireworksAISimilarityType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propUrl.TryReadProperty(ref reader, options, PropUrl, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.FireworksAIServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ApiKey = propApiKey.Value, + Dimensions = propDimensions.Value, + ModelId = propModelId.Value, + RateLimit = propRateLimit.Value, + Similarity = propSimilarity.Value, + Url = propUrl.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.FireworksAIServiceSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); + writer.WriteProperty(options, PropDimensions, value.Dimensions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropModelId, value.ModelId, null, null); + writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); + writer.WriteProperty(options, PropSimilarity, value.Similarity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Inference.FireworksAISimilarityType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropUrl, value.Url, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAIServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAIServiceSettings.g.cs new file mode 100644 index 00000000000..0d772b66eb4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAIServiceSettings.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.FireworksAIServiceSettingsConverter))] +public sealed partial class FireworksAIServiceSettings +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public FireworksAIServiceSettings(string apiKey, string modelId) + { + ApiKey = apiKey; + ModelId = modelId; + } + + public FireworksAIServiceSettings() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal FireworksAIServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// A valid API key for your Fireworks AI account. + /// You can find or create your API keys in the Fireworks AI dashboard. + /// + /// + /// IMPORTANT: You need to provide the API key only once, during the inference model creation. + /// The get inference endpoint API does not retrieve your API key. + /// + /// + public required string ApiKey { get; set; } + + /// + /// + /// For a text_embedding task, the number of dimensions the resulting output embeddings should have. + /// Variable-length embeddings are supported via this parameter. + /// + /// + public int? Dimensions { get; set; } + + /// + /// + /// The name of the model to use for the inference task. + /// Refer to the Fireworks AI documentation for the list of available models for chat completion, completion, and text embedding. + /// For text embedding, supported models include the Qwen3 embedding family (e.g. fireworks/qwen3-embedding-8b) and other models in the Fireworks model library. + /// + /// + public required string ModelId { get; set; } + + /// + /// + /// This setting helps to minimize the number of rate limit errors returned from the Fireworks AI API. + /// Rate limit grouping is per API key only. + /// By default, the fireworksai service sets the number of requests allowed per minute to 6000. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.RateLimitSetting? RateLimit { get; set; } + + /// + /// + /// For a text_embedding task, the similarity measure. One of cosine, dot_product, l2_norm. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.FireworksAISimilarityType? Similarity { get; set; } + + /// + /// + /// The URL endpoint to use for the requests. + /// If not provided, the default Fireworks AI API endpoint is used. + /// + /// + public string? Url { get; set; } +} + +public readonly partial struct FireworksAiServiceSettingsDescriptor +{ + internal Elastic.Clients.Elasticsearch.Inference.FireworksAIServiceSettings Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public FireworksAiServiceSettingsDescriptor(Elastic.Clients.Elasticsearch.Inference.FireworksAIServiceSettings instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public FireworksAiServiceSettingsDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Inference.FireworksAIServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Inference.FireworksAiServiceSettingsDescriptor(Elastic.Clients.Elasticsearch.Inference.FireworksAIServiceSettings instance) => new Elastic.Clients.Elasticsearch.Inference.FireworksAiServiceSettingsDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Inference.FireworksAIServiceSettings(Elastic.Clients.Elasticsearch.Inference.FireworksAiServiceSettingsDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// A valid API key for your Fireworks AI account. + /// You can find or create your API keys in the Fireworks AI dashboard. + /// + /// + /// IMPORTANT: You need to provide the API key only once, during the inference model creation. + /// The get inference endpoint API does not retrieve your API key. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.FireworksAiServiceSettingsDescriptor ApiKey(string value) + { + Instance.ApiKey = value; + return this; + } + + /// + /// + /// For a text_embedding task, the number of dimensions the resulting output embeddings should have. + /// Variable-length embeddings are supported via this parameter. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.FireworksAiServiceSettingsDescriptor Dimensions(int? value) + { + Instance.Dimensions = value; + return this; + } + + /// + /// + /// The name of the model to use for the inference task. + /// Refer to the Fireworks AI documentation for the list of available models for chat completion, completion, and text embedding. + /// For text embedding, supported models include the Qwen3 embedding family (e.g. fireworks/qwen3-embedding-8b) and other models in the Fireworks model library. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.FireworksAiServiceSettingsDescriptor ModelId(string value) + { + Instance.ModelId = value; + return this; + } + + /// + /// + /// This setting helps to minimize the number of rate limit errors returned from the Fireworks AI API. + /// Rate limit grouping is per API key only. + /// By default, the fireworksai service sets the number of requests allowed per minute to 6000. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.FireworksAiServiceSettingsDescriptor RateLimit(Elastic.Clients.Elasticsearch.Inference.RateLimitSetting? value) + { + Instance.RateLimit = value; + return this; + } + + /// + /// + /// This setting helps to minimize the number of rate limit errors returned from the Fireworks AI API. + /// Rate limit grouping is per API key only. + /// By default, the fireworksai service sets the number of requests allowed per minute to 6000. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.FireworksAiServiceSettingsDescriptor RateLimit() + { + Instance.RateLimit = Elastic.Clients.Elasticsearch.Inference.RateLimitSettingDescriptor.Build(null); + return this; + } + + /// + /// + /// This setting helps to minimize the number of rate limit errors returned from the Fireworks AI API. + /// Rate limit grouping is per API key only. + /// By default, the fireworksai service sets the number of requests allowed per minute to 6000. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.FireworksAiServiceSettingsDescriptor RateLimit(System.Action? action) + { + Instance.RateLimit = Elastic.Clients.Elasticsearch.Inference.RateLimitSettingDescriptor.Build(action); + return this; + } + + /// + /// + /// For a text_embedding task, the similarity measure. One of cosine, dot_product, l2_norm. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.FireworksAiServiceSettingsDescriptor Similarity(Elastic.Clients.Elasticsearch.Inference.FireworksAISimilarityType? value) + { + Instance.Similarity = value; + return this; + } + + /// + /// + /// The URL endpoint to use for the requests. + /// If not provided, the default Fireworks AI API endpoint is used. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.FireworksAiServiceSettingsDescriptor Url(string? value) + { + Instance.Url = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Inference.FireworksAIServiceSettings Build(System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Inference.FireworksAiServiceSettingsDescriptor(new Elastic.Clients.Elasticsearch.Inference.FireworksAIServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAISimilarityType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAISimilarityType.Converters.g.cs new file mode 100644 index 00000000000..b461cb8f4d6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAISimilarityType.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class FireworksAISimilarityTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCosine = System.Text.Json.JsonEncodedText.Encode("cosine"u8); + private static readonly System.Text.Json.JsonEncodedText MemberDotProduct = System.Text.Json.JsonEncodedText.Encode("dot_product"u8); + private static readonly System.Text.Json.JsonEncodedText MemberL2Norm = System.Text.Json.JsonEncodedText.Encode("l2_norm"u8); + + public override Elastic.Clients.Elasticsearch.Inference.FireworksAISimilarityType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCosine)) + { + return Elastic.Clients.Elasticsearch.Inference.FireworksAISimilarityType.Cosine; + } + + if (reader.ValueTextEquals(MemberDotProduct)) + { + return Elastic.Clients.Elasticsearch.Inference.FireworksAISimilarityType.DotProduct; + } + + if (reader.ValueTextEquals(MemberL2Norm)) + { + return Elastic.Clients.Elasticsearch.Inference.FireworksAISimilarityType.L2Norm; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCosine.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.FireworksAISimilarityType.Cosine; + } + + if (string.Equals(value, MemberDotProduct.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.FireworksAISimilarityType.DotProduct; + } + + if (string.Equals(value, MemberL2Norm.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.FireworksAISimilarityType.L2Norm; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.FireworksAISimilarityType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.FireworksAISimilarityType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.FireworksAISimilarityType.Cosine: + writer.WriteStringValue(MemberCosine); + break; + case Elastic.Clients.Elasticsearch.Inference.FireworksAISimilarityType.DotProduct: + writer.WriteStringValue(MemberDotProduct); + break; + case Elastic.Clients.Elasticsearch.Inference.FireworksAISimilarityType.L2Norm: + writer.WriteStringValue(MemberL2Norm); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.FireworksAISimilarityType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.FireworksAISimilarityType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.FireworksAISimilarityType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAISimilarityType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAISimilarityType.g.cs new file mode 100644 index 00000000000..f5ac894634a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAISimilarityType.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.FireworksAISimilarityTypeConverter))] +public enum FireworksAISimilarityType +{ + [System.Runtime.Serialization.EnumMember(Value = "cosine")] + Cosine, + [System.Runtime.Serialization.EnumMember(Value = "dot_product")] + DotProduct, + [System.Runtime.Serialization.EnumMember(Value = "l2_norm")] + L2Norm +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAITaskSettings.Converters.g.cs similarity index 54% rename from src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleResponse.Converters.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAITaskSettings.Converters.g.cs index 3468154795f..66291f5201d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleResponse.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAITaskSettings.Converters.g.cs @@ -21,19 +21,26 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; +namespace Elastic.Clients.Elasticsearch.Inference.Json; -public sealed partial class GetSampleResponseConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class FireworksAITaskSettingsConverter : System.Text.Json.Serialization.JsonConverter { - private static readonly System.Text.Json.JsonEncodedText PropSample = System.Text.Json.JsonEncodedText.Encode("sample"u8); + private static readonly System.Text.Json.JsonEncodedText PropHeaders = System.Text.Json.JsonEncodedText.Encode("headers"u8); + private static readonly System.Text.Json.JsonEncodedText PropUser = System.Text.Json.JsonEncodedText.Encode("user"u8); - public override Elastic.Clients.Elasticsearch.IndexManagement.GetSampleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + public override Elastic.Clients.Elasticsearch.Inference.FireworksAITaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propSample = default; + LocalJsonValue propHeaders = default; + LocalJsonValue propUser = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { - if (propSample.TryReadProperty(ref reader, options, PropSample, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + if (propHeaders.TryReadProperty(ref reader, options, PropHeaders, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propUser.TryReadProperty(ref reader, options, PropUser, null)) { continue; } @@ -48,16 +55,18 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.GetSampleResponse } reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + return new Elastic.Clients.Elasticsearch.Inference.FireworksAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { - Sample = propSample.Value + Headers = propHeaders.Value, + User = propUser.Value }; } - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetSampleResponse value, System.Text.Json.JsonSerializerOptions options) + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.FireworksAITaskSettings value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); - writer.WriteProperty(options, PropSample, value.Sample, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropHeaders, value.Headers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropUser, value.User, null, null); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAITaskSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAITaskSettings.g.cs new file mode 100644 index 00000000000..37a2cad3c24 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAITaskSettings.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.FireworksAITaskSettingsConverter))] +public sealed partial class FireworksAITaskSettings +{ + public FireworksAITaskSettings() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal FireworksAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// For a completion orchat_completion task. Specifies custom HTTP header parameters. + /// For example: + /// + /// + /// "headers":{ + /// "Custom-Header": "Some-Value", + /// "Another-Custom-Header": "Another-Value" + /// } + /// + /// + public object? Headers { get; set; } + + /// + /// + /// For a completion orchat_completion task, specify the user issuing the request. + /// This information can be used for abuse detection. + /// + /// + public string? User { get; set; } +} + +public readonly partial struct FireworksAiTaskSettingsDescriptor +{ + internal Elastic.Clients.Elasticsearch.Inference.FireworksAITaskSettings Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public FireworksAiTaskSettingsDescriptor(Elastic.Clients.Elasticsearch.Inference.FireworksAITaskSettings instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public FireworksAiTaskSettingsDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Inference.FireworksAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Inference.FireworksAiTaskSettingsDescriptor(Elastic.Clients.Elasticsearch.Inference.FireworksAITaskSettings instance) => new Elastic.Clients.Elasticsearch.Inference.FireworksAiTaskSettingsDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Inference.FireworksAITaskSettings(Elastic.Clients.Elasticsearch.Inference.FireworksAiTaskSettingsDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// For a completion orchat_completion task. Specifies custom HTTP header parameters. + /// For example: + /// + /// + /// "headers":{ + /// "Custom-Header": "Some-Value", + /// "Another-Custom-Header": "Another-Value" + /// } + /// + /// + public Elastic.Clients.Elasticsearch.Inference.FireworksAiTaskSettingsDescriptor Headers(object? value) + { + Instance.Headers = value; + return this; + } + + /// + /// + /// For a completion orchat_completion task, specify the user issuing the request. + /// This information can be used for abuse detection. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.FireworksAiTaskSettingsDescriptor User(string? value) + { + Instance.User = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Inference.FireworksAITaskSettings Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Inference.FireworksAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Inference.FireworksAiTaskSettingsDescriptor(new Elastic.Clients.Elasticsearch.Inference.FireworksAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAITaskType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAITaskType.Converters.g.cs new file mode 100644 index 00000000000..ad072e9ebff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAITaskType.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class FireworksAITaskTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"u8); + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"u8); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"u8); + + public override Elastic.Clients.Elasticsearch.Inference.FireworksAITaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberChatCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.FireworksAITaskType.ChatCompletion; + } + + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.FireworksAITaskType.Completion; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.FireworksAITaskType.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.FireworksAITaskType.ChatCompletion; + } + + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.FireworksAITaskType.Completion; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.FireworksAITaskType.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.FireworksAITaskType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.FireworksAITaskType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.FireworksAITaskType.ChatCompletion: + writer.WriteStringValue(MemberChatCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.FireworksAITaskType.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.FireworksAITaskType.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.FireworksAITaskType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.FireworksAITaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.FireworksAITaskType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAITaskType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAITaskType.g.cs new file mode 100644 index 00000000000..196fecb8d8c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAITaskType.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.FireworksAITaskTypeConverter))] +public enum FireworksAITaskType +{ + [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] + ChatCompletion, + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.Converters.g.cs index fdf14cfcf34..0b04d1d81bb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.Converters.g.cs @@ -27,6 +27,7 @@ public sealed partial class GoogleVertexAIServiceSettingsConverter : System.Text { private static readonly System.Text.Json.JsonEncodedText PropDimensions = System.Text.Json.JsonEncodedText.Encode("dimensions"u8); private static readonly System.Text.Json.JsonEncodedText PropLocation = System.Text.Json.JsonEncodedText.Encode("location"u8); + private static readonly System.Text.Json.JsonEncodedText PropMaxBatchSize = System.Text.Json.JsonEncodedText.Encode("max_batch_size"u8); private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"u8); private static readonly System.Text.Json.JsonEncodedText PropProjectId = System.Text.Json.JsonEncodedText.Encode("project_id"u8); private static readonly System.Text.Json.JsonEncodedText PropProvider = System.Text.Json.JsonEncodedText.Encode("provider"u8); @@ -40,6 +41,7 @@ public override Elastic.Clients.Elasticsearch.Inference.GoogleVertexAIServiceSet reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propDimensions = default; LocalJsonValue propLocation = default; + LocalJsonValue propMaxBatchSize = default; LocalJsonValue propModelId = default; LocalJsonValue propProjectId = default; LocalJsonValue propProvider = default; @@ -59,6 +61,11 @@ public override Elastic.Clients.Elasticsearch.Inference.GoogleVertexAIServiceSet continue; } + if (propMaxBatchSize.TryReadProperty(ref reader, options, PropMaxBatchSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) { continue; @@ -108,6 +115,7 @@ public override Elastic.Clients.Elasticsearch.Inference.GoogleVertexAIServiceSet { Dimensions = propDimensions.Value, Location = propLocation.Value, + MaxBatchSize = propMaxBatchSize.Value, ModelId = propModelId.Value, ProjectId = propProjectId.Value, Provider = propProvider.Value, @@ -123,6 +131,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteStartObject(); writer.WriteProperty(options, PropDimensions, value.Dimensions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropLocation, value.Location, null, null); + writer.WriteProperty(options, PropMaxBatchSize, value.MaxBatchSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropModelId, value.ModelId, null, null); writer.WriteProperty(options, PropProjectId, value.ProjectId, null, null); writer.WriteProperty(options, PropProvider, value.Provider, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Inference.GoogleModelGardenProvider? v) => w.WriteNullableValue(o, v)); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.g.cs index cd7eba725ed..1b6c95541ae 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.g.cs @@ -61,6 +61,44 @@ internal GoogleVertexAIServiceSettings(Elastic.Clients.Elasticsearch.Serializati /// public string? Location { get; set; } + /// + /// + /// Only applicable for the text_embedding task type. + /// Controls the batch size of chunked inference requests sent to Google Vertex AI. + /// + /// + /// Setting this parameter lower reduces the risk of exceeding token limits but may result in more API calls. Setting it higher increases throughput but may risk hitting token limits. + /// + /// + /// To estimate a safe max_batch_size value, you can use it together with the max_chunk_size parameter using the following formula: + /// max_batch_size ≈ max_chunk_size × 1.3 × 512 ÷ 20000 + /// + /// + /// Where: + /// + /// + /// + /// + /// 1.3 is an approximate tokens-per-word ratio + /// + /// + /// + /// + /// 512 is the maximum number of chunks that can be generated per document + /// + /// + /// + /// + /// 20000 is the Google Vertex AI token limit per request + /// + /// + /// + /// + /// This estimate assumes the worst-case scenario with a document generating the maximum 512 chunks. + /// + /// + public int? MaxBatchSize { get; set; } + /// /// /// The name of the model to use for the inference task. @@ -189,6 +227,48 @@ public Elastic.Clients.Elasticsearch.Inference.GoogleVertexAiServiceSettingsDesc return this; } + /// + /// + /// Only applicable for the text_embedding task type. + /// Controls the batch size of chunked inference requests sent to Google Vertex AI. + /// + /// + /// Setting this parameter lower reduces the risk of exceeding token limits but may result in more API calls. Setting it higher increases throughput but may risk hitting token limits. + /// + /// + /// To estimate a safe max_batch_size value, you can use it together with the max_chunk_size parameter using the following formula: + /// max_batch_size ≈ max_chunk_size × 1.3 × 512 ÷ 20000 + /// + /// + /// Where: + /// + /// + /// + /// + /// 1.3 is an approximate tokens-per-word ratio + /// + /// + /// + /// + /// 512 is the maximum number of chunks that can be generated per document + /// + /// + /// + /// + /// 20000 is the Google Vertex AI token limit per request + /// + /// + /// + /// + /// This estimate assumes the worst-case scenario with a document generating the maximum 512 chunks. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.GoogleVertexAiServiceSettingsDescriptor MaxBatchSize(int? value) + { + Instance.MaxBatchSize = value; + return this; + } + /// /// /// The name of the model to use for the inference task. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GroqServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GroqServiceSettings.g.cs index a51c8d53188..04f583bb228 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GroqServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GroqServiceSettings.g.cs @@ -49,8 +49,6 @@ internal GroqServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonCon /// /// IMPORTANT: You need to provide the API key only once, during the inference model creation. /// The get inference endpoint API does not retrieve your API key. - /// After creating the inference model, you cannot change the associated API key. - /// If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. /// /// public string? ApiKey { get; set; } @@ -106,8 +104,6 @@ public GroqServiceSettingsDescriptor() /// /// IMPORTANT: You need to provide the API key only once, during the inference model creation. /// The get inference endpoint API does not retrieve your API key. - /// After creating the inference model, you cannot change the associated API key. - /// If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. /// /// public Elastic.Clients.Elasticsearch.Inference.GroqServiceSettingsDescriptor ApiKey(string? value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/HuggingFaceServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/HuggingFaceServiceSettings.g.cs index 022324098ed..742ed170315 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/HuggingFaceServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/HuggingFaceServiceSettings.g.cs @@ -51,8 +51,6 @@ internal HuggingFaceServiceSettings(Elastic.Clients.Elasticsearch.Serialization. /// /// IMPORTANT: You need to provide the API key only once, during the inference model creation. /// The get inference endpoint API does not retrieve your API key. - /// After creating the inference model, you cannot change the associated API key. - /// If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. /// /// public required string ApiKey { get; set; } @@ -113,8 +111,6 @@ public HuggingFaceServiceSettingsDescriptor() /// /// IMPORTANT: You need to provide the API key only once, during the inference model creation. /// The get inference endpoint API does not retrieve your API key. - /// After creating the inference model, you cannot change the associated API key. - /// If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. /// /// public Elastic.Clients.Elasticsearch.Inference.HuggingFaceServiceSettingsDescriptor ApiKey(string value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpoint.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpoint.g.cs index d609ce8d0ae..7e17fa1ab42 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpoint.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpoint.g.cs @@ -51,7 +51,7 @@ internal InferenceEndpoint(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// @@ -106,7 +106,7 @@ public InferenceEndpointDescriptor() /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// @@ -119,7 +119,7 @@ public Elastic.Clients.Elasticsearch.Inference.InferenceEndpointDescriptor Chunk /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// @@ -132,7 +132,7 @@ public Elastic.Clients.Elasticsearch.Inference.InferenceEndpointDescriptor Chunk /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpointInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpointInfo.g.cs index ad26f69ca10..a2c221fa3ac 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpointInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpointInfo.g.cs @@ -53,7 +53,7 @@ internal InferenceEndpointInfo(Elastic.Clients.Elasticsearch.Serialization.JsonC /// /// /// The chunking configuration object. - /// Applies only to the sparse_embedding and text_embedding task types. + /// Applies only to the embedding, sparse_embedding and text_embedding task types. /// Not applicable to the rerank, completion, or chat_completion task types. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceResult.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceResult.Converters.g.cs index 55dd0fc6f9d..7fd666298a9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceResult.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceResult.Converters.g.cs @@ -26,6 +26,9 @@ namespace Elastic.Clients.Elasticsearch.Inference.Json; public sealed partial class InferenceResultConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText VariantCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText VariantEmbeddings = System.Text.Json.JsonEncodedText.Encode("embeddings"); + private static readonly System.Text.Json.JsonEncodedText VariantEmbeddingsBits = System.Text.Json.JsonEncodedText.Encode("embeddings_bits"); + private static readonly System.Text.Json.JsonEncodedText VariantEmbeddingsBytes = System.Text.Json.JsonEncodedText.Encode("embeddings_bytes"); private static readonly System.Text.Json.JsonEncodedText VariantRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); private static readonly System.Text.Json.JsonEncodedText VariantSparseEmbedding = System.Text.Json.JsonEncodedText.Encode("sparse_embedding"); private static readonly System.Text.Json.JsonEncodedText VariantTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); @@ -47,6 +50,30 @@ public override Elastic.Clients.Elasticsearch.Inference.InferenceResult Read(ref continue; } + if (reader.ValueTextEquals(VariantEmbeddings)) + { + variantType = VariantEmbeddings.Value; + reader.Read(); + variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); + continue; + } + + if (reader.ValueTextEquals(VariantEmbeddingsBits)) + { + variantType = VariantEmbeddingsBits.Value; + reader.Read(); + variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); + continue; + } + + if (reader.ValueTextEquals(VariantEmbeddingsBytes)) + { + variantType = VariantEmbeddingsBytes.Value; + reader.Read(); + variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); + continue; + } + if (reader.ValueTextEquals(VariantRerank)) { variantType = VariantRerank.Value; @@ -67,7 +94,7 @@ public override Elastic.Clients.Elasticsearch.Inference.InferenceResult Read(ref { variantType = VariantTextEmbedding.Value; reader.Read(); - variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); + variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); continue; } @@ -75,7 +102,7 @@ public override Elastic.Clients.Elasticsearch.Inference.InferenceResult Read(ref { variantType = VariantTextEmbeddingBits.Value; reader.Read(); - variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); + variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); continue; } @@ -83,7 +110,7 @@ public override Elastic.Clients.Elasticsearch.Inference.InferenceResult Read(ref { variantType = VariantTextEmbeddingBytes.Value; reader.Read(); - variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); + variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); continue; } @@ -114,6 +141,15 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien case "completion": writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); break; + case "embeddings": + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + break; + case "embeddings_bits": + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + break; + case "embeddings_bytes": + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + break; case "rerank": writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); break; @@ -121,13 +157,13 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); break; case "text_embedding": - writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); break; case "text_embedding_bits": - writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); break; case "text_embedding_bytes": - writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); break; default: throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Inference.InferenceResult)}'."); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceResult.g.cs index 5624733975e..073e31e434e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceResult.g.cs @@ -40,16 +40,18 @@ internal InferenceResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstru } public System.Collections.Generic.IReadOnlyCollection? Completion { get => GetVariant>("completion"); set => SetVariant("completion", value); } + public System.Collections.Generic.IReadOnlyCollection? Embeddings { get => GetVariant>("embeddings"); set => SetVariant("embeddings", value); } + public System.Collections.Generic.IReadOnlyCollection? EmbeddingsBits { get => GetVariant>("embeddings_bits"); set => SetVariant("embeddings_bits", value); } + public System.Collections.Generic.IReadOnlyCollection? EmbeddingsBytes { get => GetVariant>("embeddings_bytes"); set => SetVariant("embeddings_bytes", value); } public System.Collections.Generic.IReadOnlyCollection? Rerank { get => GetVariant>("rerank"); set => SetVariant("rerank", value); } public System.Collections.Generic.IReadOnlyCollection? SparseEmbedding { get => GetVariant>("sparse_embedding"); set => SetVariant("sparse_embedding", value); } - public System.Collections.Generic.IReadOnlyCollection? TextEmbedding { get => GetVariant>("text_embedding"); set => SetVariant("text_embedding", value); } - public System.Collections.Generic.IReadOnlyCollection? TextEmbeddingBits { get => GetVariant>("text_embedding_bits"); set => SetVariant("text_embedding_bits", value); } - public System.Collections.Generic.IReadOnlyCollection? TextEmbeddingBytes { get => GetVariant>("text_embedding_bytes"); set => SetVariant("text_embedding_bytes", value); } + public System.Collections.Generic.IReadOnlyCollection? TextEmbedding { get => GetVariant>("text_embedding"); set => SetVariant("text_embedding", value); } + public System.Collections.Generic.IReadOnlyCollection? TextEmbeddingBits { get => GetVariant>("text_embedding_bits"); set => SetVariant("text_embedding_bits", value); } + public System.Collections.Generic.IReadOnlyCollection? TextEmbeddingBytes { get => GetVariant>("text_embedding_bytes"); set => SetVariant("text_embedding_bytes", value); } public static implicit operator Elastic.Clients.Elasticsearch.Inference.InferenceResult(Elastic.Clients.Elasticsearch.Inference.CompletionResult[] value) => new Elastic.Clients.Elasticsearch.Inference.InferenceResult { Completion = value }; public static implicit operator Elastic.Clients.Elasticsearch.Inference.InferenceResult(Elastic.Clients.Elasticsearch.Inference.RankedDocument[] value) => new Elastic.Clients.Elasticsearch.Inference.InferenceResult { Rerank = value }; public static implicit operator Elastic.Clients.Elasticsearch.Inference.InferenceResult(Elastic.Clients.Elasticsearch.Inference.SparseEmbeddingResult[] value) => new Elastic.Clients.Elasticsearch.Inference.InferenceResult { SparseEmbedding = value }; - public static implicit operator Elastic.Clients.Elasticsearch.Inference.InferenceResult(Elastic.Clients.Elasticsearch.Inference.TextEmbeddingResult[] value) => new Elastic.Clients.Elasticsearch.Inference.InferenceResult { TextEmbedding = value }; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] private T? GetVariant(string type) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAIElementType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAIElementType.Converters.g.cs new file mode 100644 index 00000000000..b3bf60a98aa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAIElementType.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class JinaAIElementTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberBinary = System.Text.Json.JsonEncodedText.Encode("binary"u8); + private static readonly System.Text.Json.JsonEncodedText MemberBit = System.Text.Json.JsonEncodedText.Encode("bit"u8); + private static readonly System.Text.Json.JsonEncodedText MemberFloat = System.Text.Json.JsonEncodedText.Encode("float"u8); + + public override Elastic.Clients.Elasticsearch.Inference.JinaAIElementType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberBinary)) + { + return Elastic.Clients.Elasticsearch.Inference.JinaAIElementType.Binary; + } + + if (reader.ValueTextEquals(MemberBit)) + { + return Elastic.Clients.Elasticsearch.Inference.JinaAIElementType.Bit; + } + + if (reader.ValueTextEquals(MemberFloat)) + { + return Elastic.Clients.Elasticsearch.Inference.JinaAIElementType.Float; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberBinary.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.JinaAIElementType.Binary; + } + + if (string.Equals(value, MemberBit.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.JinaAIElementType.Bit; + } + + if (string.Equals(value, MemberFloat.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.JinaAIElementType.Float; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.JinaAIElementType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.JinaAIElementType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.JinaAIElementType.Binary: + writer.WriteStringValue(MemberBinary); + break; + case Elastic.Clients.Elasticsearch.Inference.JinaAIElementType.Bit: + writer.WriteStringValue(MemberBit); + break; + case Elastic.Clients.Elasticsearch.Inference.JinaAIElementType.Float: + writer.WriteStringValue(MemberFloat); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.JinaAIElementType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.JinaAIElementType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.JinaAIElementType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAIElementType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAIElementType.g.cs new file mode 100644 index 00000000000..ca900d308d6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAIElementType.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.JinaAIElementTypeConverter))] +public enum JinaAIElementType +{ + [System.Runtime.Serialization.EnumMember(Value = "binary")] + Binary, + [System.Runtime.Serialization.EnumMember(Value = "bit")] + Bit, + [System.Runtime.Serialization.EnumMember(Value = "float")] + Float +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAIServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAIServiceSettings.Converters.g.cs index 8925621bdb4..cc62fb72ff7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAIServiceSettings.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAIServiceSettings.Converters.g.cs @@ -26,7 +26,10 @@ namespace Elastic.Clients.Elasticsearch.Inference.Json; public sealed partial class JinaAIServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"u8); + private static readonly System.Text.Json.JsonEncodedText PropDimensions = System.Text.Json.JsonEncodedText.Encode("dimensions"u8); + private static readonly System.Text.Json.JsonEncodedText PropElementType = System.Text.Json.JsonEncodedText.Encode("element_type"u8); private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"u8); + private static readonly System.Text.Json.JsonEncodedText PropMultimodalModel = System.Text.Json.JsonEncodedText.Encode("multimodal_model"u8); private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"u8); private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"u8); @@ -34,7 +37,10 @@ public override Elastic.Clients.Elasticsearch.Inference.JinaAIServiceSettings Re { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propApiKey = default; - LocalJsonValue propModelId = default; + LocalJsonValue propDimensions = default; + LocalJsonValue propElementType = default; + LocalJsonValue propModelId = default; + LocalJsonValue propMultimodalModel = default; LocalJsonValue propRateLimit = default; LocalJsonValue propSimilarity = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) @@ -44,11 +50,26 @@ public override Elastic.Clients.Elasticsearch.Inference.JinaAIServiceSettings Re continue; } + if (propDimensions.TryReadProperty(ref reader, options, PropDimensions, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propElementType.TryReadProperty(ref reader, options, PropElementType, static Elastic.Clients.Elasticsearch.Inference.JinaAIElementType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) { continue; } + if (propMultimodalModel.TryReadProperty(ref reader, options, PropMultimodalModel, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) { continue; @@ -72,7 +93,10 @@ public override Elastic.Clients.Elasticsearch.Inference.JinaAIServiceSettings Re return new Elastic.Clients.Elasticsearch.Inference.JinaAIServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { ApiKey = propApiKey.Value, + Dimensions = propDimensions.Value, + ElementType = propElementType.Value, ModelId = propModelId.Value, + MultimodalModel = propMultimodalModel.Value, RateLimit = propRateLimit.Value, Similarity = propSimilarity.Value }; @@ -82,7 +106,10 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); + writer.WriteProperty(options, PropDimensions, value.Dimensions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropElementType, value.ElementType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Inference.JinaAIElementType? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropModelId, value.ModelId, null, null); + writer.WriteProperty(options, PropMultimodalModel, value.MultimodalModel, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); writer.WriteProperty(options, PropSimilarity, value.Similarity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType? v) => w.WriteNullableValue(o, v)); writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAIServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAIServiceSettings.g.cs index fccded0814d..039c903ce9c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAIServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAIServiceSettings.g.cs @@ -27,9 +27,10 @@ namespace Elastic.Clients.Elasticsearch.Inference; public sealed partial class JinaAIServiceSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public JinaAIServiceSettings(string apiKey) + public JinaAIServiceSettings(string apiKey, string modelId) { ApiKey = apiKey; + ModelId = modelId; } public JinaAIServiceSettings() @@ -49,20 +50,45 @@ internal JinaAIServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonC /// /// IMPORTANT: You need to provide the API key only once, during the inference model creation. /// The get inference endpoint API does not retrieve your API key. - /// After creating the inference model, you cannot change the associated API key. - /// If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. /// /// public required string ApiKey { get; set; } + /// + /// + /// For an embedding or text_embedding task, the number of dimensions the resulting output embeddings should have. + /// By default, the model's standard output dimension is used. + /// Refer to the Jina documentation for more information. + /// + /// + public int? Dimensions { get; set; } + + /// + /// + /// For an embedding or text_embedding task, the data type returned by the model. + /// Use bit for binary embeddings, which are encoded as bytes with signed int8 precision. + /// Use binary for binary embeddings, which are encoded as bytes with signed int8 precision (this is a synonym of bit). + /// Use float for the default float embeddings. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.JinaAIElementType? ElementType { get; set; } + /// /// /// The name of the model to use for the inference task. - /// For a rerank task, it is required. - /// For a text_embedding task, it is optional. /// /// - public string? ModelId { get; set; } + public required string ModelId { get; set; } + + /// + /// + /// For the embedding task, whether the model supports multimodal inputs. If true, requests sent to the Jina model + /// will use the multimodal request format (a list of objects). If false, requests sent to the model will use the same + /// format as the text_embedding task (a list of strings). Setting this to false allows the embedding task to be + /// used with models that do not support multimodal requests. + /// + /// + public bool? MultimodalModel { get; set; } /// /// @@ -74,7 +100,7 @@ internal JinaAIServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonC /// /// - /// For a text_embedding task, the similarity measure. One of cosine, dot_product, l2_norm. + /// For an embedding or text_embedding task, the similarity measure. One of cosine, dot_product, l2_norm. /// The default values varies with the embedding type. /// For example, a float embedding type uses a dot_product similarity measure by default. /// @@ -108,8 +134,6 @@ public JinaAiServiceSettingsDescriptor() /// /// IMPORTANT: You need to provide the API key only once, during the inference model creation. /// The get inference endpoint API does not retrieve your API key. - /// After creating the inference model, you cannot change the associated API key. - /// If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. /// /// public Elastic.Clients.Elasticsearch.Inference.JinaAiServiceSettingsDescriptor ApiKey(string value) @@ -118,19 +142,58 @@ public Elastic.Clients.Elasticsearch.Inference.JinaAiServiceSettingsDescriptor A return this; } + /// + /// + /// For an embedding or text_embedding task, the number of dimensions the resulting output embeddings should have. + /// By default, the model's standard output dimension is used. + /// Refer to the Jina documentation for more information. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.JinaAiServiceSettingsDescriptor Dimensions(int? value) + { + Instance.Dimensions = value; + return this; + } + + /// + /// + /// For an embedding or text_embedding task, the data type returned by the model. + /// Use bit for binary embeddings, which are encoded as bytes with signed int8 precision. + /// Use binary for binary embeddings, which are encoded as bytes with signed int8 precision (this is a synonym of bit). + /// Use float for the default float embeddings. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.JinaAiServiceSettingsDescriptor ElementType(Elastic.Clients.Elasticsearch.Inference.JinaAIElementType? value) + { + Instance.ElementType = value; + return this; + } + /// /// /// The name of the model to use for the inference task. - /// For a rerank task, it is required. - /// For a text_embedding task, it is optional. /// /// - public Elastic.Clients.Elasticsearch.Inference.JinaAiServiceSettingsDescriptor ModelId(string? value) + public Elastic.Clients.Elasticsearch.Inference.JinaAiServiceSettingsDescriptor ModelId(string value) { Instance.ModelId = value; return this; } + /// + /// + /// For the embedding task, whether the model supports multimodal inputs. If true, requests sent to the Jina model + /// will use the multimodal request format (a list of objects). If false, requests sent to the model will use the same + /// format as the text_embedding task (a list of strings). Setting this to false allows the embedding task to be + /// used with models that do not support multimodal requests. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.JinaAiServiceSettingsDescriptor MultimodalModel(bool? value = true) + { + Instance.MultimodalModel = value; + return this; + } + /// /// /// This setting helps to minimize the number of rate limit errors returned from JinaAI. @@ -169,7 +232,7 @@ public Elastic.Clients.Elasticsearch.Inference.JinaAiServiceSettingsDescriptor R /// /// - /// For a text_embedding task, the similarity measure. One of cosine, dot_product, l2_norm. + /// For an embedding or text_embedding task, the similarity measure. One of cosine, dot_product, l2_norm. /// The default values varies with the embedding type. /// For example, a float embedding type uses a dot_product similarity measure by default. /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskSettings.Converters.g.cs index 8944bee6489..806ba1f6e82 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskSettings.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskSettings.Converters.g.cs @@ -25,24 +25,31 @@ namespace Elastic.Clients.Elasticsearch.Inference.Json; public sealed partial class JinaAITaskSettingsConverter : System.Text.Json.Serialization.JsonConverter { + private static readonly System.Text.Json.JsonEncodedText PropInputType = System.Text.Json.JsonEncodedText.Encode("input_type"u8); + private static readonly System.Text.Json.JsonEncodedText PropLateChunking = System.Text.Json.JsonEncodedText.Encode("late_chunking"u8); private static readonly System.Text.Json.JsonEncodedText PropReturnDocuments = System.Text.Json.JsonEncodedText.Encode("return_documents"u8); - private static readonly System.Text.Json.JsonEncodedText PropTask = System.Text.Json.JsonEncodedText.Encode("task"u8); private static readonly System.Text.Json.JsonEncodedText PropTopN = System.Text.Json.JsonEncodedText.Encode("top_n"u8); public override Elastic.Clients.Elasticsearch.Inference.JinaAITaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propInputType = default; + LocalJsonValue propLateChunking = default; LocalJsonValue propReturnDocuments = default; - LocalJsonValue propTask = default; LocalJsonValue propTopN = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { - if (propReturnDocuments.TryReadProperty(ref reader, options, PropReturnDocuments, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + if (propInputType.TryReadProperty(ref reader, options, PropInputType, static Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLateChunking.TryReadProperty(ref reader, options, PropLateChunking, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) { continue; } - if (propTask.TryReadProperty(ref reader, options, PropTask, static Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + if (propReturnDocuments.TryReadProperty(ref reader, options, PropReturnDocuments, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) { continue; } @@ -64,8 +71,9 @@ public override Elastic.Clients.Elasticsearch.Inference.JinaAITaskSettings Read( reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); return new Elastic.Clients.Elasticsearch.Inference.JinaAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { + InputType = propInputType.Value, + LateChunking = propLateChunking.Value, ReturnDocuments = propReturnDocuments.Value, - Task = propTask.Value, TopN = propTopN.Value }; } @@ -73,8 +81,9 @@ public override Elastic.Clients.Elasticsearch.Inference.JinaAITaskSettings Read( public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.JinaAITaskSettings value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); + writer.WriteProperty(options, PropInputType, value.InputType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLateChunking, value.LateChunking, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropReturnDocuments, value.ReturnDocuments, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTask, value.Task, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropTopN, value.TopN, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); writer.WriteEndObject(); } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskSettings.g.cs index c35e4637cb3..1ec8c5d317a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskSettings.g.cs @@ -38,20 +38,13 @@ internal JinaAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonCons /// /// - /// For a rerank task, return the doc text within the results. - /// - /// - public bool? ReturnDocuments { get; set; } - - /// - /// - /// For a text_embedding task, the task passed to the model. + /// For an embedding or text_embedding task, the task passed to the model. /// Valid values are: /// /// /// /// - /// classification: Use it for embeddings passed through a text classifier. + /// classification: Use it for embeddings passed through a classifier. /// /// /// @@ -71,7 +64,28 @@ internal JinaAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonCons /// /// /// - public Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask? Task { get; set; } + public Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask? InputType { get; set; } + + /// + /// + /// For an embedding or text_embedding task, controls when text is split into chunks. + /// When set to true, a request from Elasticsearch contains only chunks related to a single document. Instead of batching chunks across documents, Elasticsearch sends them in separate requests. This ensures that chunk embeddings retain context from the entire document, improving semantic quality. + /// + /// + /// If a document exceeds the model's context limits, or if the document contains non-text inputs (relevant when using the multimodal embedding task), late chunking is automatically disabled for that document only and standard chunking is used instead. + /// + /// + /// If not specified, defaults to false. + /// + /// + public bool? LateChunking { get; set; } + + /// + /// + /// For a rerank task, return the doc text within the results. + /// + /// + public bool? ReturnDocuments { get; set; } /// /// @@ -104,24 +118,13 @@ public JinaAiTaskSettingsDescriptor() /// /// - /// For a rerank task, return the doc text within the results. - /// - /// - public Elastic.Clients.Elasticsearch.Inference.JinaAiTaskSettingsDescriptor ReturnDocuments(bool? value = true) - { - Instance.ReturnDocuments = value; - return this; - } - - /// - /// - /// For a text_embedding task, the task passed to the model. + /// For an embedding or text_embedding task, the task passed to the model. /// Valid values are: /// /// /// /// - /// classification: Use it for embeddings passed through a text classifier. + /// classification: Use it for embeddings passed through a classifier. /// /// /// @@ -141,9 +144,38 @@ public Elastic.Clients.Elasticsearch.Inference.JinaAiTaskSettingsDescriptor Retu /// /// /// - public Elastic.Clients.Elasticsearch.Inference.JinaAiTaskSettingsDescriptor Task(Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask? value) + public Elastic.Clients.Elasticsearch.Inference.JinaAiTaskSettingsDescriptor InputType(Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask? value) + { + Instance.InputType = value; + return this; + } + + /// + /// + /// For an embedding or text_embedding task, controls when text is split into chunks. + /// When set to true, a request from Elasticsearch contains only chunks related to a single document. Instead of batching chunks across documents, Elasticsearch sends them in separate requests. This ensures that chunk embeddings retain context from the entire document, improving semantic quality. + /// + /// + /// If a document exceeds the model's context limits, or if the document contains non-text inputs (relevant when using the multimodal embedding task), late chunking is automatically disabled for that document only and standard chunking is used instead. + /// + /// + /// If not specified, defaults to false. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.JinaAiTaskSettingsDescriptor LateChunking(bool? value = true) + { + Instance.LateChunking = value; + return this; + } + + /// + /// + /// For a rerank task, return the doc text within the results. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.JinaAiTaskSettingsDescriptor ReturnDocuments(bool? value = true) { - Instance.Task = value; + Instance.ReturnDocuments = value; return this; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskType.Converters.g.cs index 58269a68073..f2d0978dcde 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskType.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskType.Converters.g.cs @@ -25,11 +25,17 @@ namespace Elastic.Clients.Elasticsearch.Inference.Json; public sealed partial class JinaAITaskTypeConverter : System.Text.Json.Serialization.JsonConverter { + private static readonly System.Text.Json.JsonEncodedText MemberEmbedding = System.Text.Json.JsonEncodedText.Encode("embedding"u8); private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"u8); private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"u8); public override Elastic.Clients.Elasticsearch.Inference.JinaAITaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { + if (reader.ValueTextEquals(MemberEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.JinaAITaskType.Embedding; + } + if (reader.ValueTextEquals(MemberRerank)) { return Elastic.Clients.Elasticsearch.Inference.JinaAITaskType.Rerank; @@ -41,6 +47,11 @@ public override Elastic.Clients.Elasticsearch.Inference.JinaAITaskType Read(ref } var value = reader.GetString()!; + if (string.Equals(value, MemberEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.JinaAITaskType.Embedding; + } + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) { return Elastic.Clients.Elasticsearch.Inference.JinaAITaskType.Rerank; @@ -58,6 +69,9 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { switch (value) { + case Elastic.Clients.Elasticsearch.Inference.JinaAITaskType.Embedding: + writer.WriteStringValue(MemberEmbedding); + break; case Elastic.Clients.Elasticsearch.Inference.JinaAITaskType.Rerank: writer.WriteStringValue(MemberRerank); break; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskType.g.cs index 934318b2ff6..e31d1579c1e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskType.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskType.g.cs @@ -26,6 +26,8 @@ namespace Elastic.Clients.Elasticsearch.Inference; [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.JinaAITaskTypeConverter))] public enum JinaAITaskType { + [System.Runtime.Serialization.EnumMember(Value = "embedding")] + Embedding, [System.Runtime.Serialization.EnumMember(Value = "rerank")] Rerank, [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/MistralServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/MistralServiceSettings.g.cs index 5979ca87324..d1a0cff2d7c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/MistralServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/MistralServiceSettings.g.cs @@ -51,8 +51,6 @@ internal MistralServiceSettings(Elastic.Clients.Elasticsearch.Serialization.Json /// /// IMPORTANT: You need to provide the API key only once, during the inference model creation. /// The get inference endpoint API does not retrieve your API key. - /// After creating the inference model, you cannot change the associated API key. - /// If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. /// /// public required string ApiKey { get; set; } @@ -108,8 +106,6 @@ public MistralServiceSettingsDescriptor() /// /// IMPORTANT: You need to provide the API key only once, during the inference model creation. /// The get inference endpoint API does not retrieve your API key. - /// After creating the inference model, you cannot change the associated API key. - /// If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. /// /// public Elastic.Clients.Elasticsearch.Inference.MistralServiceSettingsDescriptor ApiKey(string value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAIServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAIServiceSettings.Converters.g.cs index 8ea4bd0b6cb..325236cd875 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAIServiceSettings.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAIServiceSettings.Converters.g.cs @@ -30,6 +30,7 @@ public sealed partial class OpenAIServiceSettingsConverter : System.Text.Json.Se private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"u8); private static readonly System.Text.Json.JsonEncodedText PropOrganizationId = System.Text.Json.JsonEncodedText.Encode("organization_id"u8); private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"u8); + private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"u8); private static readonly System.Text.Json.JsonEncodedText PropUrl = System.Text.Json.JsonEncodedText.Encode("url"u8); public override Elastic.Clients.Elasticsearch.Inference.OpenAIServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) @@ -40,6 +41,7 @@ public override Elastic.Clients.Elasticsearch.Inference.OpenAIServiceSettings Re LocalJsonValue propModelId = default; LocalJsonValue propOrganizationId = default; LocalJsonValue propRateLimit = default; + LocalJsonValue propSimilarity = default; LocalJsonValue propUrl = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -68,6 +70,11 @@ public override Elastic.Clients.Elasticsearch.Inference.OpenAIServiceSettings Re continue; } + if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, static Elastic.Clients.Elasticsearch.Inference.OpenAISimilarityType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + if (propUrl.TryReadProperty(ref reader, options, PropUrl, null)) { continue; @@ -90,6 +97,7 @@ public override Elastic.Clients.Elasticsearch.Inference.OpenAIServiceSettings Re ModelId = propModelId.Value, OrganizationId = propOrganizationId.Value, RateLimit = propRateLimit.Value, + Similarity = propSimilarity.Value, Url = propUrl.Value }; } @@ -102,6 +110,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropModelId, value.ModelId, null, null); writer.WriteProperty(options, PropOrganizationId, value.OrganizationId, null, null); writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); + writer.WriteProperty(options, PropSimilarity, value.Similarity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Inference.OpenAISimilarityType? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropUrl, value.Url, null, null); writer.WriteEndObject(); } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAIServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAIServiceSettings.g.cs index 70b4b320b7e..3997881846c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAIServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAIServiceSettings.g.cs @@ -51,8 +51,6 @@ internal OpenAIServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonC /// /// IMPORTANT: You need to provide the API key only once, during the inference model creation. /// The get inference endpoint API does not retrieve your API key. - /// After creating the inference model, you cannot change the associated API key. - /// If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. /// /// public required string ApiKey { get; set; } @@ -92,6 +90,13 @@ internal OpenAIServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonC /// public Elastic.Clients.Elasticsearch.Inference.RateLimitSetting? RateLimit { get; set; } + /// + /// + /// For a text_embedding task, the similarity measure. One of cosine, dot_product, l2_norm. Defaults to dot_product. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.OpenAISimilarityType? Similarity { get; set; } + /// /// /// The URL endpoint to use for the requests. @@ -128,8 +133,6 @@ public OpenAiServiceSettingsDescriptor() /// /// IMPORTANT: You need to provide the API key only once, during the inference model creation. /// The get inference endpoint API does not retrieve your API key. - /// After creating the inference model, you cannot change the associated API key. - /// If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. /// /// public Elastic.Clients.Elasticsearch.Inference.OpenAiServiceSettingsDescriptor ApiKey(string value) @@ -217,6 +220,17 @@ public Elastic.Clients.Elasticsearch.Inference.OpenAiServiceSettingsDescriptor R return this; } + /// + /// + /// For a text_embedding task, the similarity measure. One of cosine, dot_product, l2_norm. Defaults to dot_product. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.OpenAiServiceSettingsDescriptor Similarity(Elastic.Clients.Elasticsearch.Inference.OpenAISimilarityType? value) + { + Instance.Similarity = value; + return this; + } + /// /// /// The URL endpoint to use for the requests. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAISimilarityType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAISimilarityType.Converters.g.cs new file mode 100644 index 00000000000..ccd941b7aa5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAISimilarityType.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class OpenAISimilarityTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCosine = System.Text.Json.JsonEncodedText.Encode("cosine"u8); + private static readonly System.Text.Json.JsonEncodedText MemberDotProduct = System.Text.Json.JsonEncodedText.Encode("dot_product"u8); + private static readonly System.Text.Json.JsonEncodedText MemberL2Norm = System.Text.Json.JsonEncodedText.Encode("l2_norm"u8); + + public override Elastic.Clients.Elasticsearch.Inference.OpenAISimilarityType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCosine)) + { + return Elastic.Clients.Elasticsearch.Inference.OpenAISimilarityType.Cosine; + } + + if (reader.ValueTextEquals(MemberDotProduct)) + { + return Elastic.Clients.Elasticsearch.Inference.OpenAISimilarityType.DotProduct; + } + + if (reader.ValueTextEquals(MemberL2Norm)) + { + return Elastic.Clients.Elasticsearch.Inference.OpenAISimilarityType.L2Norm; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCosine.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.OpenAISimilarityType.Cosine; + } + + if (string.Equals(value, MemberDotProduct.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.OpenAISimilarityType.DotProduct; + } + + if (string.Equals(value, MemberL2Norm.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.OpenAISimilarityType.L2Norm; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.OpenAISimilarityType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.OpenAISimilarityType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.OpenAISimilarityType.Cosine: + writer.WriteStringValue(MemberCosine); + break; + case Elastic.Clients.Elasticsearch.Inference.OpenAISimilarityType.DotProduct: + writer.WriteStringValue(MemberDotProduct); + break; + case Elastic.Clients.Elasticsearch.Inference.OpenAISimilarityType.L2Norm: + writer.WriteStringValue(MemberL2Norm); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.OpenAISimilarityType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.OpenAISimilarityType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.OpenAISimilarityType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAISimilarityType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAISimilarityType.g.cs new file mode 100644 index 00000000000..278837e4c9d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAISimilarityType.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.OpenAISimilarityTypeConverter))] +public enum OpenAISimilarityType +{ + [System.Runtime.Serialization.EnumMember(Value = "cosine")] + Cosine, + [System.Runtime.Serialization.EnumMember(Value = "dot_product")] + DotProduct, + [System.Runtime.Serialization.EnumMember(Value = "l2_norm")] + L2Norm +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskSettings.g.cs index e895ed51904..4a1e663bdb8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskSettings.g.cs @@ -52,7 +52,7 @@ internal OpenAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonCons /// /// - /// For a completion or text_embedding task, specify the user issuing the request. + /// For a completion, chat_completion, or text_embedding task, specify the user issuing the request. /// This information can be used for abuse detection. /// /// @@ -98,7 +98,7 @@ public Elastic.Clients.Elasticsearch.Inference.OpenAiTaskSettingsDescriptor Head /// /// - /// For a completion or text_embedding task, specify the user issuing the request. + /// For a completion, chat_completion, or text_embedding task, specify the user issuing the request. /// This information can be used for abuse detection. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RateLimitSetting.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RateLimitSetting.g.cs index 61198426418..d9c1b0e9d03 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RateLimitSetting.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RateLimitSetting.g.cs @@ -54,6 +54,11 @@ internal RateLimitSetting(Elastic.Clients.Elasticsearch.Serialization.JsonConstr /// /// /// + /// amazonbedrock service: 240 + /// + /// + /// + /// /// anthropic service: 50 /// /// @@ -89,6 +94,11 @@ internal RateLimitSetting(Elastic.Clients.Elasticsearch.Serialization.JsonConstr /// /// /// + /// fireworksai service: 6000 + /// + /// + /// + /// /// googleaistudio service: 360 /// /// @@ -184,6 +194,11 @@ public RateLimitSettingDescriptor() /// /// /// + /// amazonbedrock service: 240 + /// + /// + /// + /// /// anthropic service: 50 /// /// @@ -219,6 +234,11 @@ public RateLimitSettingDescriptor() /// /// /// + /// fireworksai service: 6000 + /// + /// + /// + /// /// googleaistudio service: 360 /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestEmbedding.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestEmbedding.Converters.g.cs new file mode 100644 index 00000000000..a393296d43f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestEmbedding.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class RequestEmbeddingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropInput = System.Text.Json.JsonEncodedText.Encode("input"u8); + private static readonly System.Text.Json.JsonEncodedText PropInputType = System.Text.Json.JsonEncodedText.Encode("input_type"u8); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"u8); + + public override Elastic.Clients.Elasticsearch.Inference.RequestEmbedding Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue, System.Collections.Generic.ICollection>> propInput = default; + LocalJsonValue propInputType = default; + LocalJsonValue propTaskSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propInput.TryReadProperty(ref reader, options, PropInput, static Elastic.Clients.Elasticsearch.Union, System.Collections.Generic.ICollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue, System.Collections.Generic.ICollection>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.T1(ref r, o)), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.T1(ref r, o)), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.T2(ref r, o)), static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)!)) + { + continue; + } + + if (propInputType.TryReadProperty(ref reader, options, PropInputType, null)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.RequestEmbedding(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Input = propInput.Value, + InputType = propInputType.Value, + TaskSettings = propTaskSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.RequestEmbedding value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropInput, value.Input, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union, System.Collections.Generic.ICollection> v) => w.WriteUnionValue, System.Collections.Generic.ICollection>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); + writer.WriteProperty(options, PropInputType, value.InputType, null, null); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestEmbedding.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestEmbedding.g.cs new file mode 100644 index 00000000000..b4dd82bb1e6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestEmbedding.g.cs @@ -0,0 +1,278 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the 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.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.RequestEmbeddingConverter))] +public sealed partial class RequestEmbedding +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public RequestEmbedding(Elastic.Clients.Elasticsearch.Union, System.Collections.Generic.ICollection> input) + { + Input = input; + } + + public RequestEmbedding() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal RequestEmbedding(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// Inference input. + /// Either a string, an array of strings, a content object, or an array of content objects. + /// + /// + /// string example: + /// + /// + /// "input": "Some text" + /// + /// + /// string array example: + /// + /// + /// "input": ["Some text", "Some more text"] + /// + /// + /// content object example: + /// + /// + /// "input": { + /// "content": { + /// "type": "image", + /// "format": "base64", + /// "value": "data:image/jpg;base64,..." + /// } + /// } + /// + /// + /// content object array example: + /// + /// + /// "input": [ + /// { + /// "content": { + /// "type": "text", + /// "format": "text", + /// "value": "Some text to generate an embedding" + /// } + /// }, + /// { + /// "content": { + /// "type": "image", + /// "format": "base64", + /// "value": "data:image/jpg;base64,..." + /// } + /// } + /// ] + /// + /// + public required Elastic.Clients.Elasticsearch.Union, System.Collections.Generic.ICollection> Input { get; set; } + + /// + /// + /// The input data type for the embedding model. Possible values include: + /// + /// + /// + /// + /// SEARCH + /// + /// + /// + /// + /// INGEST + /// + /// + /// + /// + /// CLASSIFICATION + /// + /// + /// + /// + /// CLUSTERING + /// + /// + /// + /// + /// Not all models support all values. Unsupported values will trigger a validation exception. + /// Accepted values depend on the configured inference service, refer to the relevant service-specific documentation for more info. + /// + /// + /// info + /// The input_type parameter specified on the root level of the request body will take precedence over the input_type parameter specified in task_settings. + /// + /// + public string? InputType { get; set; } + + /// + /// + /// Task settings for the individual inference request. These settings are specific to the <task_type> you specified and override the task settings specified when initializing the service. + /// + /// + public object? TaskSettings { get; set; } +} + +public readonly partial struct RequestEmbeddingDescriptor +{ + internal Elastic.Clients.Elasticsearch.Inference.RequestEmbedding Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public RequestEmbeddingDescriptor(Elastic.Clients.Elasticsearch.Inference.RequestEmbedding instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public RequestEmbeddingDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Inference.RequestEmbedding(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Inference.RequestEmbeddingDescriptor(Elastic.Clients.Elasticsearch.Inference.RequestEmbedding instance) => new Elastic.Clients.Elasticsearch.Inference.RequestEmbeddingDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Inference.RequestEmbedding(Elastic.Clients.Elasticsearch.Inference.RequestEmbeddingDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// Inference input. + /// Either a string, an array of strings, a content object, or an array of content objects. + /// + /// + /// string example: + /// + /// + /// "input": "Some text" + /// + /// + /// string array example: + /// + /// + /// "input": ["Some text", "Some more text"] + /// + /// + /// content object example: + /// + /// + /// "input": { + /// "content": { + /// "type": "image", + /// "format": "base64", + /// "value": "data:image/jpg;base64,..." + /// } + /// } + /// + /// + /// content object array example: + /// + /// + /// "input": [ + /// { + /// "content": { + /// "type": "text", + /// "format": "text", + /// "value": "Some text to generate an embedding" + /// } + /// }, + /// { + /// "content": { + /// "type": "image", + /// "format": "base64", + /// "value": "data:image/jpg;base64,..." + /// } + /// } + /// ] + /// + /// + public Elastic.Clients.Elasticsearch.Inference.RequestEmbeddingDescriptor Input(Elastic.Clients.Elasticsearch.Union, System.Collections.Generic.ICollection> value) + { + Instance.Input = value; + return this; + } + + /// + /// + /// The input data type for the embedding model. Possible values include: + /// + /// + /// + /// + /// SEARCH + /// + /// + /// + /// + /// INGEST + /// + /// + /// + /// + /// CLASSIFICATION + /// + /// + /// + /// + /// CLUSTERING + /// + /// + /// + /// + /// Not all models support all values. Unsupported values will trigger a validation exception. + /// Accepted values depend on the configured inference service, refer to the relevant service-specific documentation for more info. + /// + /// + /// info + /// The input_type parameter specified on the root level of the request body will take precedence over the input_type parameter specified in task_settings. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.RequestEmbeddingDescriptor InputType(string? value) + { + Instance.InputType = value; + return this; + } + + /// + /// + /// Task settings for the individual inference request. These settings are specific to the <task_type> you specified and override the task settings specified when initializing the service. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.RequestEmbeddingDescriptor TaskSettings(object? value) + { + Instance.TaskSettings = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Inference.RequestEmbedding Build(System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Inference.RequestEmbeddingDescriptor(new Elastic.Clients.Elasticsearch.Inference.RequestEmbedding(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/SparseEmbeddingResult.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/SparseEmbeddingResult.Converters.g.cs index 1bb14f5043c..a8b641d01ce 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/SparseEmbeddingResult.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/SparseEmbeddingResult.Converters.g.cs @@ -26,11 +26,13 @@ namespace Elastic.Clients.Elasticsearch.Inference.Json; public sealed partial class SparseEmbeddingResultConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropEmbedding = System.Text.Json.JsonEncodedText.Encode("embedding"u8); + private static readonly System.Text.Json.JsonEncodedText PropIsTruncated = System.Text.Json.JsonEncodedText.Encode("is_truncated"u8); public override Elastic.Clients.Elasticsearch.Inference.SparseEmbeddingResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue> propEmbedding = default; + LocalJsonValue propIsTruncated = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propEmbedding.TryReadProperty(ref reader, options, PropEmbedding, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) @@ -38,6 +40,11 @@ public override Elastic.Clients.Elasticsearch.Inference.SparseEmbeddingResult Re continue; } + if (propIsTruncated.TryReadProperty(ref reader, options, PropIsTruncated, null)) + { + continue; + } + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) { reader.SafeSkip(); @@ -50,7 +57,8 @@ public override Elastic.Clients.Elasticsearch.Inference.SparseEmbeddingResult Re reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); return new Elastic.Clients.Elasticsearch.Inference.SparseEmbeddingResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { - Embedding = propEmbedding.Value + Embedding = propEmbedding.Value, + IsTruncated = propIsTruncated.Value }; } @@ -58,6 +66,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropEmbedding, value.Embedding, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropIsTruncated, value.IsTruncated, null, null); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/SparseEmbeddingResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/SparseEmbeddingResult.g.cs index b103d09ec96..ec31e73d849 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/SparseEmbeddingResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/SparseEmbeddingResult.g.cs @@ -27,9 +27,10 @@ namespace Elastic.Clients.Elasticsearch.Inference; public sealed partial class SparseEmbeddingResult { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public SparseEmbeddingResult(System.Collections.Generic.IReadOnlyDictionary embedding) + public SparseEmbeddingResult(System.Collections.Generic.IReadOnlyDictionary embedding, bool isTruncated) { Embedding = embedding; + IsTruncated = isTruncated; } public SparseEmbeddingResult() @@ -43,4 +44,11 @@ internal SparseEmbeddingResult(Elastic.Clients.Elasticsearch.Serialization.JsonC } public required System.Collections.Generic.IReadOnlyDictionary Embedding { get; set; } + + /// + /// + /// Indicates if the text input was truncated in the request sent to the service + /// + /// + public required bool IsTruncated { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskType.Converters.g.cs index d84e4320fad..6a05ec95e55 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskType.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskType.Converters.g.cs @@ -27,6 +27,7 @@ public sealed partial class TaskTypeConverter : System.Text.Json.Serialization.J { private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"u8); private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"u8); + private static readonly System.Text.Json.JsonEncodedText MemberEmbedding = System.Text.Json.JsonEncodedText.Encode("embedding"u8); private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"u8); private static readonly System.Text.Json.JsonEncodedText MemberSparseEmbedding = System.Text.Json.JsonEncodedText.Encode("sparse_embedding"u8); private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"u8); @@ -43,6 +44,11 @@ public override Elastic.Clients.Elasticsearch.Inference.TaskType Read(ref System return Elastic.Clients.Elasticsearch.Inference.TaskType.Completion; } + if (reader.ValueTextEquals(MemberEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskType.Embedding; + } + if (reader.ValueTextEquals(MemberRerank)) { return Elastic.Clients.Elasticsearch.Inference.TaskType.Rerank; @@ -69,6 +75,11 @@ public override Elastic.Clients.Elasticsearch.Inference.TaskType Read(ref System return Elastic.Clients.Elasticsearch.Inference.TaskType.Completion; } + if (string.Equals(value, MemberEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskType.Embedding; + } + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) { return Elastic.Clients.Elasticsearch.Inference.TaskType.Rerank; @@ -97,6 +108,9 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien case Elastic.Clients.Elasticsearch.Inference.TaskType.Completion: writer.WriteStringValue(MemberCompletion); break; + case Elastic.Clients.Elasticsearch.Inference.TaskType.Embedding: + writer.WriteStringValue(MemberEmbedding); + break; case Elastic.Clients.Elasticsearch.Inference.TaskType.Rerank: writer.WriteStringValue(MemberRerank); break; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskType.g.cs index 00416479812..04492cdfde2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskType.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskType.g.cs @@ -30,6 +30,8 @@ public enum TaskType ChatCompletion, [System.Runtime.Serialization.EnumMember(Value = "completion")] Completion, + [System.Runtime.Serialization.EnumMember(Value = "embedding")] + Embedding, [System.Runtime.Serialization.EnumMember(Value = "rerank")] Rerank, [System.Runtime.Serialization.EnumMember(Value = "sparse_embedding")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAmazonBedrock.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAmazonBedrock.Converters.g.cs index f90ef882bfd..551d14f0689 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAmazonBedrock.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAmazonBedrock.Converters.g.cs @@ -25,11 +25,17 @@ namespace Elastic.Clients.Elasticsearch.Inference.Json; public sealed partial class TaskTypeAmazonBedrockConverter : System.Text.Json.Serialization.JsonConverter { + private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"u8); private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"u8); private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"u8); public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { + if (reader.ValueTextEquals(MemberChatCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock.ChatCompletion; + } + if (reader.ValueTextEquals(MemberCompletion)) { return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock.Completion; @@ -41,6 +47,11 @@ public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock Re } var value = reader.GetString()!; + if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock.ChatCompletion; + } + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) { return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock.Completion; @@ -58,6 +69,9 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { switch (value) { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock.ChatCompletion: + writer.WriteStringValue(MemberChatCompletion); + break; case Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock.Completion: writer.WriteStringValue(MemberCompletion); break; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAmazonBedrock.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAmazonBedrock.g.cs index a8d0157feea..366136d575d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAmazonBedrock.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAmazonBedrock.g.cs @@ -26,6 +26,8 @@ namespace Elastic.Clients.Elasticsearch.Inference; [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TaskTypeAmazonBedrockConverter))] public enum TaskTypeAmazonBedrock { + [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] + ChatCompletion, [System.Runtime.Serialization.EnumMember(Value = "completion")] Completion, [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeFireworksAI.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeFireworksAI.Converters.g.cs new file mode 100644 index 00000000000..07adca2cb63 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeFireworksAI.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TaskTypeFireworksAIConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"u8); + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"u8); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"u8); + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeFireworksAI Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberChatCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeFireworksAI.ChatCompletion; + } + + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeFireworksAI.Completion; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeFireworksAI.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeFireworksAI.ChatCompletion; + } + + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeFireworksAI.Completion; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeFireworksAI.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeFireworksAI)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeFireworksAI value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeFireworksAI.ChatCompletion: + writer.WriteStringValue(MemberChatCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeFireworksAI.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeFireworksAI.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeFireworksAI)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeFireworksAI ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeFireworksAI value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeFireworksAI.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeFireworksAI.g.cs new file mode 100644 index 00000000000..cc66b5052c0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeFireworksAI.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TaskTypeFireworksAIConverter))] +public enum TaskTypeFireworksAI +{ + [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] + ChatCompletion, + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeJinaAi.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeJinaAi.Converters.g.cs index 42463528a43..6c6d9f14b06 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeJinaAi.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeJinaAi.Converters.g.cs @@ -25,11 +25,17 @@ namespace Elastic.Clients.Elasticsearch.Inference.Json; public sealed partial class TaskTypeJinaAiConverter : System.Text.Json.Serialization.JsonConverter { + private static readonly System.Text.Json.JsonEncodedText MemberEmbedding = System.Text.Json.JsonEncodedText.Encode("embedding"u8); private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"u8); private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"u8); public override Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { + if (reader.ValueTextEquals(MemberEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi.Embedding; + } + if (reader.ValueTextEquals(MemberRerank)) { return Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi.Rerank; @@ -41,6 +47,11 @@ public override Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi Read(ref } var value = reader.GetString()!; + if (string.Equals(value, MemberEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi.Embedding; + } + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) { return Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi.Rerank; @@ -58,6 +69,9 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { switch (value) { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi.Embedding: + writer.WriteStringValue(MemberEmbedding); + break; case Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi.Rerank: writer.WriteStringValue(MemberRerank); break; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeJinaAi.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeJinaAi.g.cs index 0fe1406d187..d31b1ceab40 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeJinaAi.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeJinaAi.g.cs @@ -26,6 +26,8 @@ namespace Elastic.Clients.Elasticsearch.Inference; [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TaskTypeJinaAiConverter))] public enum TaskTypeJinaAi { + [System.Runtime.Serialization.EnumMember(Value = "embedding")] + Embedding, [System.Runtime.Serialization.EnumMember(Value = "rerank")] Rerank, [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingInferenceResult.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingInferenceResult.Converters.g.cs index 26fe9ec3ff8..7a270beb5e9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingInferenceResult.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingInferenceResult.Converters.g.cs @@ -40,7 +40,7 @@ public override Elastic.Clients.Elasticsearch.Inference.TextEmbeddingInferenceRe { variantType = VariantTextEmbedding.Value; reader.Read(); - variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); + variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); continue; } @@ -48,7 +48,7 @@ public override Elastic.Clients.Elasticsearch.Inference.TextEmbeddingInferenceRe { variantType = VariantTextEmbeddingBits.Value; reader.Read(); - variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); + variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); continue; } @@ -56,7 +56,7 @@ public override Elastic.Clients.Elasticsearch.Inference.TextEmbeddingInferenceRe { variantType = VariantTextEmbeddingBytes.Value; reader.Read(); - variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); + variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); continue; } @@ -85,13 +85,13 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien case null: break; case "text_embedding": - writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); break; case "text_embedding_bits": - writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); break; case "text_embedding_bytes": - writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); break; default: throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Inference.TextEmbeddingInferenceResult)}'."); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingInferenceResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingInferenceResult.g.cs index 33bbefe940e..fc1ef8aa204 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingInferenceResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingInferenceResult.g.cs @@ -39,11 +39,11 @@ internal TextEmbeddingInferenceResult(Elastic.Clients.Elasticsearch.Serializatio _ = sentinel; } - public System.Collections.Generic.IReadOnlyCollection? TextEmbedding { get => GetVariant>("text_embedding"); set => SetVariant("text_embedding", value); } - public System.Collections.Generic.IReadOnlyCollection? TextEmbeddingBits { get => GetVariant>("text_embedding_bits"); set => SetVariant("text_embedding_bits", value); } - public System.Collections.Generic.IReadOnlyCollection? TextEmbeddingBytes { get => GetVariant>("text_embedding_bytes"); set => SetVariant("text_embedding_bytes", value); } + public System.Collections.Generic.IReadOnlyCollection? TextEmbedding { get => GetVariant>("text_embedding"); set => SetVariant("text_embedding", value); } + public System.Collections.Generic.IReadOnlyCollection? TextEmbeddingBits { get => GetVariant>("text_embedding_bits"); set => SetVariant("text_embedding_bits", value); } + public System.Collections.Generic.IReadOnlyCollection? TextEmbeddingBytes { get => GetVariant>("text_embedding_bytes"); set => SetVariant("text_embedding_bytes", value); } - public static implicit operator Elastic.Clients.Elasticsearch.Inference.TextEmbeddingInferenceResult(Elastic.Clients.Elasticsearch.Inference.TextEmbeddingResult[] value) => new Elastic.Clients.Elasticsearch.Inference.TextEmbeddingInferenceResult { TextEmbedding = value }; + public static implicit operator Elastic.Clients.Elasticsearch.Inference.TextEmbeddingInferenceResult(Elastic.Clients.Elasticsearch.Inference.DenseEmbeddingResult[] value) => new Elastic.Clients.Elasticsearch.Inference.TextEmbeddingInferenceResult { TextEmbedding = value }; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] private T? GetVariant(string type) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/WatsonxServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/WatsonxServiceSettings.g.cs index 95de8766ea7..fbca7de6277 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/WatsonxServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/WatsonxServiceSettings.g.cs @@ -54,8 +54,6 @@ internal WatsonxServiceSettings(Elastic.Clients.Elasticsearch.Serialization.Json /// /// IMPORTANT: You need to provide the API key only once, during the inference model creation. /// The get inference endpoint API does not retrieve your API key. - /// After creating the inference model, you cannot change the associated API key. - /// If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. /// /// public required string ApiKey { get; set; } @@ -127,8 +125,6 @@ public WatsonxServiceSettingsDescriptor() /// /// IMPORTANT: You need to provide the API key only once, during the inference model creation. /// The get inference endpoint API does not retrieve your API key. - /// After creating the inference model, you cannot change the associated API key. - /// If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. /// /// public Elastic.Clients.Elasticsearch.Inference.WatsonxServiceSettingsDescriptor ApiKey(string value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/WatsonxTaskType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/WatsonxTaskType.Converters.g.cs index 8a970c10534..70774a87dd0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/WatsonxTaskType.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/WatsonxTaskType.Converters.g.cs @@ -27,6 +27,7 @@ public sealed partial class WatsonxTaskTypeConverter : System.Text.Json.Serializ { private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"u8); private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"u8); + private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"u8); private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"u8); public override Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) @@ -41,6 +42,11 @@ public override Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType Read(ref return Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.Completion; } + if (reader.ValueTextEquals(MemberRerank)) + { + return Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.Rerank; + } + if (reader.ValueTextEquals(MemberTextEmbedding)) { return Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.TextEmbedding; @@ -57,6 +63,11 @@ public override Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType Read(ref return Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.Completion; } + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.Rerank; + } + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) { return Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.TextEmbedding; @@ -75,6 +86,9 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien case Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.Completion: writer.WriteStringValue(MemberCompletion); break; + case Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.Rerank: + writer.WriteStringValue(MemberRerank); + break; case Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.TextEmbedding: writer.WriteStringValue(MemberTextEmbedding); break; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/WatsonxTaskType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/WatsonxTaskType.g.cs index 296a8a994e1..1ca987bf601 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/WatsonxTaskType.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/WatsonxTaskType.g.cs @@ -30,6 +30,8 @@ public enum WatsonxTaskType ChatCompletion, [System.Runtime.Serialization.EnumMember(Value = "completion")] Completion, + [System.Runtime.Serialization.EnumMember(Value = "rerank")] + Rerank, [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] TextEmbedding } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AppendProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AppendProcessor.Converters.g.cs index 93da32ace36..a2cca6928d7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AppendProcessor.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AppendProcessor.Converters.g.cs @@ -30,7 +30,9 @@ public sealed partial class AppendProcessorConverter : System.Text.Json.Serializ private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"u8); private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"u8); private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"u8); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreEmptyValues = System.Text.Json.JsonEncodedText.Encode("ignore_empty_values"u8); private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"u8); + private static readonly System.Text.Json.JsonEncodedText PropMediaType = System.Text.Json.JsonEncodedText.Encode("media_type"u8); private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"u8); private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"u8); private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"u8); @@ -43,7 +45,9 @@ public override Elastic.Clients.Elasticsearch.Ingest.AppendProcessor Read(ref Sy LocalJsonValue propDescription = default; LocalJsonValue propField = default; LocalJsonValue propIf = default; + LocalJsonValue propIgnoreEmptyValues = default; LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propMediaType = default; LocalJsonValue?> propOnFailure = default; LocalJsonValue propTag = default; LocalJsonValue?> propValue = default; @@ -74,11 +78,21 @@ public override Elastic.Clients.Elasticsearch.Ingest.AppendProcessor Read(ref Sy continue; } + if (propIgnoreEmptyValues.TryReadProperty(ref reader, options, PropIgnoreEmptyValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) { continue; } + if (propMediaType.TryReadProperty(ref reader, options, PropMediaType, null)) + { + continue; + } + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) { continue; @@ -111,7 +125,9 @@ public override Elastic.Clients.Elasticsearch.Ingest.AppendProcessor Read(ref Sy Description = propDescription.Value, Field = propField.Value, If = propIf.Value, + IgnoreEmptyValues = propIgnoreEmptyValues.Value, IgnoreFailure = propIgnoreFailure.Value, + MediaType = propMediaType.Value, OnFailure = propOnFailure.Value, Tag = propTag.Value, Value = propValue.Value @@ -126,7 +142,9 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropDescription, value.Description, null, null); writer.WriteProperty(options, PropField, value.Field, null, null); writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreEmptyValues, value.IgnoreEmptyValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMediaType, value.MediaType, null, null); writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); writer.WriteProperty(options, PropTag, value.Tag, null, null); writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); 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 8ee0819d208..d7cf76a9bdf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AppendProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AppendProcessor.g.cs @@ -79,6 +79,14 @@ internal AppendProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstru /// public Elastic.Clients.Elasticsearch.Script? If { get; set; } + /// + /// + /// If true, the processor will skip empty values from the source (e.g. empty strings, and null values), + /// rather than appending them to the field. + /// + /// + public bool? IgnoreEmptyValues { get; set; } + /// /// /// Ignore failures for the processor. @@ -86,6 +94,15 @@ internal AppendProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstru /// public bool? IgnoreFailure { get; set; } + /// + /// + /// The media type for encoding value. + /// Applies only when value is a template snippet. + /// Must be one of application/json, text/plain, or application/x-www-form-urlencoded. + /// + /// + public string? MediaType { get; set; } + /// /// /// Handle failures for the processor. @@ -230,6 +247,18 @@ public Elastic.Clients.Elasticsearch.Ingest.AppendProcessorDescriptor return this; } + /// + /// + /// If true, the processor will skip empty values from the source (e.g. empty strings, and null values), + /// rather than appending them to the field. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.AppendProcessorDescriptor IgnoreEmptyValues(bool? value = true) + { + Instance.IgnoreEmptyValues = value; + return this; + } + /// /// /// Ignore failures for the processor. @@ -241,6 +270,19 @@ public Elastic.Clients.Elasticsearch.Ingest.AppendProcessorDescriptor return this; } + /// + /// + /// The media type for encoding value. + /// Applies only when value is a template snippet. + /// Must be one of application/json, text/plain, or application/x-www-form-urlencoded. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.AppendProcessorDescriptor MediaType(string? value) + { + Instance.MediaType = value; + return this; + } + /// /// /// Handle failures for the processor. @@ -444,6 +486,18 @@ public Elastic.Clients.Elasticsearch.Ingest.AppendProcessorDescriptor If(System. return this; } + /// + /// + /// If true, the processor will skip empty values from the source (e.g. empty strings, and null values), + /// rather than appending them to the field. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.AppendProcessorDescriptor IgnoreEmptyValues(bool? value = true) + { + Instance.IgnoreEmptyValues = value; + return this; + } + /// /// /// Ignore failures for the processor. @@ -455,6 +509,19 @@ public Elastic.Clients.Elasticsearch.Ingest.AppendProcessorDescriptor IgnoreFail return this; } + /// + /// + /// The media type for encoding value. + /// Applies only when value is a template snippet. + /// Must be one of application/json, text/plain, or application/x-www-form-urlencoded. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.AppendProcessorDescriptor MediaType(string? value) + { + Instance.MediaType = value; + return this; + } + /// /// /// Handle failures for the processor. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CefProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CefProcessor.Converters.g.cs new file mode 100644 index 00000000000..f13f3eabc22 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CefProcessor.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class CefProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"u8); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"u8); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"u8); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreEmptyValues = System.Text.Json.JsonEncodedText.Encode("ignore_empty_values"u8); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"u8); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"u8); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"u8); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"u8); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"u8); + private static readonly System.Text.Json.JsonEncodedText PropTimezone = System.Text.Json.JsonEncodedText.Encode("timezone"u8); + + public override Elastic.Clients.Elasticsearch.Ingest.CefProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreEmptyValues = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + LocalJsonValue propTimezone = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreEmptyValues.TryReadProperty(ref reader, options, PropIgnoreEmptyValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (propTimezone.TryReadProperty(ref reader, options, PropTimezone, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.CefProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreEmptyValues = propIgnoreEmptyValues.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + OnFailure = propOnFailure.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value, + Timezone = propTimezone.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.CefProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreEmptyValues, value.IgnoreEmptyValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteProperty(options, PropTimezone, value.Timezone, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CefProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CefProcessor.g.cs new file mode 100644 index 00000000000..48c1372f1b0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CefProcessor.g.cs @@ -0,0 +1,562 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the 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.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.CefProcessorConverter))] +public sealed partial class CefProcessor +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CefProcessor(Elastic.Clients.Elasticsearch.Field field) + { + Field = field; + } + + public CefProcessor() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal CefProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + public string? Description { get; set; } + + /// + /// + /// The field containing the CEF message. + /// + /// + public required Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public Elastic.Clients.Elasticsearch.Script? If { get; set; } + + /// + /// + /// If true and value is anempty string in extensions, the processor quietly exits without modifying the document. + /// + /// + public bool? IgnoreEmptyValues { get; set; } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public bool? IgnoreFailure { get; set; } + + /// + /// + /// If true and field does not exist or is null, the processor quietly exits without modifying the document. + /// + /// + public bool? IgnoreMissing { get; set; } + + /// + /// + /// Handle failures for the processor. + /// + /// + public System.Collections.Generic.ICollection? OnFailure { get; set; } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public string? Tag { get; set; } + + /// + /// + /// The field to assign the converted value to. + /// By default, the target_field is 'cef' + /// + /// + public Elastic.Clients.Elasticsearch.Field? TargetField { get; set; } + + /// + /// + /// The timezone to use when parsing the date and when date math index supports resolves expressions into concrete index names. + /// + /// + public string? Timezone { get; set; } +} + +public readonly partial struct CefProcessorDescriptor +{ + internal Elastic.Clients.Elasticsearch.Ingest.CefProcessor Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CefProcessorDescriptor(Elastic.Clients.Elasticsearch.Ingest.CefProcessor instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CefProcessorDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Ingest.CefProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor(Elastic.Clients.Elasticsearch.Ingest.CefProcessor instance) => new Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.CefProcessor(Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor Description(string? value) + { + Instance.Description = value; + return this; + } + + /// + /// + /// The field containing the CEF message. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Field value) + { + Instance.Field = value; + return this; + } + + /// + /// + /// The field containing the CEF message. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor Field(System.Linq.Expressions.Expression> value) + { + Instance.Field = value; + return this; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor If(Elastic.Clients.Elasticsearch.Script? value) + { + Instance.If = value; + return this; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor If() + { + Instance.If = Elastic.Clients.Elasticsearch.ScriptDescriptor.Build(null); + return this; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor If(System.Action? action) + { + Instance.If = Elastic.Clients.Elasticsearch.ScriptDescriptor.Build(action); + return this; + } + + /// + /// + /// If true and value is anempty string in extensions, the processor quietly exits without modifying the document. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor IgnoreEmptyValues(bool? value = true) + { + Instance.IgnoreEmptyValues = value; + return this; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor IgnoreFailure(bool? value = true) + { + Instance.IgnoreFailure = value; + return this; + } + + /// + /// + /// If true and field does not exist or is null, the processor quietly exits without modifying the document. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor IgnoreMissing(bool? value = true) + { + Instance.IgnoreMissing = value; + return this; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor OnFailure(System.Collections.Generic.ICollection? value) + { + Instance.OnFailure = value; + return this; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor OnFailure(params Elastic.Clients.Elasticsearch.Ingest.Processor[] values) + { + Instance.OnFailure = [.. values]; + return this; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor OnFailure(params System.Action>[] actions) + { + var items = new System.Collections.Generic.List(); + foreach (var action in actions) + { + items.Add(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor.Build(action)); + } + + Instance.OnFailure = items; + return this; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor Tag(string? value) + { + Instance.Tag = value; + return this; + } + + /// + /// + /// The field to assign the converted value to. + /// By default, the target_field is 'cef' + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Field? value) + { + Instance.TargetField = value; + return this; + } + + /// + /// + /// The field to assign the converted value to. + /// By default, the target_field is 'cef' + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor TargetField(System.Linq.Expressions.Expression> value) + { + Instance.TargetField = value; + return this; + } + + /// + /// + /// The timezone to use when parsing the date and when date math index supports resolves expressions into concrete index names. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor Timezone(string? value) + { + Instance.Timezone = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Ingest.CefProcessor Build(System.Action> action) + { + var builder = new Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor(new Elastic.Clients.Elasticsearch.Ingest.CefProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} + +public readonly partial struct CefProcessorDescriptor +{ + internal Elastic.Clients.Elasticsearch.Ingest.CefProcessor Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CefProcessorDescriptor(Elastic.Clients.Elasticsearch.Ingest.CefProcessor instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CefProcessorDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Ingest.CefProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor(Elastic.Clients.Elasticsearch.Ingest.CefProcessor instance) => new Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.CefProcessor(Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor Description(string? value) + { + Instance.Description = value; + return this; + } + + /// + /// + /// The field containing the CEF message. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Field value) + { + Instance.Field = value; + return this; + } + + /// + /// + /// The field containing the CEF message. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor Field(System.Linq.Expressions.Expression> value) + { + Instance.Field = value; + return this; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor If(Elastic.Clients.Elasticsearch.Script? value) + { + Instance.If = value; + return this; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor If() + { + Instance.If = Elastic.Clients.Elasticsearch.ScriptDescriptor.Build(null); + return this; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor If(System.Action? action) + { + Instance.If = Elastic.Clients.Elasticsearch.ScriptDescriptor.Build(action); + return this; + } + + /// + /// + /// If true and value is anempty string in extensions, the processor quietly exits without modifying the document. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor IgnoreEmptyValues(bool? value = true) + { + Instance.IgnoreEmptyValues = value; + return this; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor IgnoreFailure(bool? value = true) + { + Instance.IgnoreFailure = value; + return this; + } + + /// + /// + /// If true and field does not exist or is null, the processor quietly exits without modifying the document. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor IgnoreMissing(bool? value = true) + { + Instance.IgnoreMissing = value; + return this; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor OnFailure(System.Collections.Generic.ICollection? value) + { + Instance.OnFailure = value; + return this; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor OnFailure(params Elastic.Clients.Elasticsearch.Ingest.Processor[] values) + { + Instance.OnFailure = [.. values]; + return this; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor OnFailure(params System.Action[] actions) + { + var items = new System.Collections.Generic.List(); + foreach (var action in actions) + { + items.Add(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor.Build(action)); + } + + Instance.OnFailure = items; + return this; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor OnFailure(params System.Action>[] actions) + { + var items = new System.Collections.Generic.List(); + foreach (var action in actions) + { + items.Add(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor.Build(action)); + } + + Instance.OnFailure = items; + return this; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor Tag(string? value) + { + Instance.Tag = value; + return this; + } + + /// + /// + /// The field to assign the converted value to. + /// By default, the target_field is 'cef' + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Field? value) + { + Instance.TargetField = value; + return this; + } + + /// + /// + /// The field to assign the converted value to. + /// By default, the target_field is 'cef' + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor TargetField(System.Linq.Expressions.Expression> value) + { + Instance.TargetField = value; + return this; + } + + /// + /// + /// The timezone to use when parsing the date and when date math index supports resolves expressions into concrete index names. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor Timezone(string? value) + { + Instance.Timezone = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Ingest.CefProcessor Build(System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor(new Elastic.Clients.Elasticsearch.Ingest.CefProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Processor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Processor.Converters.g.cs index 091c40c11cd..d80fdc87880 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Processor.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Processor.Converters.g.cs @@ -28,6 +28,7 @@ public sealed partial class ProcessorConverter : System.Text.Json.Serialization. private static readonly System.Text.Json.JsonEncodedText VariantAppend = System.Text.Json.JsonEncodedText.Encode("append"); private static readonly System.Text.Json.JsonEncodedText VariantAttachment = System.Text.Json.JsonEncodedText.Encode("attachment"); private static readonly System.Text.Json.JsonEncodedText VariantBytes = System.Text.Json.JsonEncodedText.Encode("bytes"); + private static readonly System.Text.Json.JsonEncodedText VariantCef = System.Text.Json.JsonEncodedText.Encode("cef"); private static readonly System.Text.Json.JsonEncodedText VariantCircle = System.Text.Json.JsonEncodedText.Encode("circle"); private static readonly System.Text.Json.JsonEncodedText VariantCommunityId = System.Text.Json.JsonEncodedText.Encode("community_id"); private static readonly System.Text.Json.JsonEncodedText VariantConvert = System.Text.Json.JsonEncodedText.Encode("convert"); @@ -102,6 +103,14 @@ public override Elastic.Clients.Elasticsearch.Ingest.Processor Read(ref System.T continue; } + if (reader.ValueTextEquals(VariantCef)) + { + variantType = VariantCef.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + if (reader.ValueTextEquals(VariantCircle)) { variantType = VariantCircle.Value; @@ -471,6 +480,9 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien case "bytes": writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.BytesProcessor)value.Variant, null, null); break; + case "cef": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.CefProcessor)value.Variant, null, null); + break; case "circle": writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.CircleProcessor)value.Variant, null, null); break; 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 d6cf2a83e2a..85a64c8bea1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Processor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Processor.g.cs @@ -66,6 +66,13 @@ internal Processor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSe /// public Elastic.Clients.Elasticsearch.Ingest.BytesProcessor? Bytes { get => GetVariant("bytes"); set => SetVariant("bytes", value); } + /// + /// + /// Converts a CEF message into a structured format. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.CefProcessor? Cef { get => GetVariant("cef"); set => SetVariant("cef", value); } + /// /// /// Converts circle definitions of shapes to regular polygons which approximate them. @@ -231,7 +238,7 @@ internal Processor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSe /// /// - /// Converts a JSON string into a structured JSON object. + /// Parses a string containing JSON data into a structured object, string, or other value. /// /// public Elastic.Clients.Elasticsearch.Ingest.JsonProcessor? Json { get => GetVariant("json"); set => SetVariant("json", value); } @@ -402,6 +409,7 @@ internal Processor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSe public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(Elastic.Clients.Elasticsearch.Ingest.AppendProcessor value) => new Elastic.Clients.Elasticsearch.Ingest.Processor { Append = value }; public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(Elastic.Clients.Elasticsearch.Ingest.AttachmentProcessor value) => new Elastic.Clients.Elasticsearch.Ingest.Processor { Attachment = value }; public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(Elastic.Clients.Elasticsearch.Ingest.BytesProcessor value) => new Elastic.Clients.Elasticsearch.Ingest.Processor { Bytes = value }; + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(Elastic.Clients.Elasticsearch.Ingest.CefProcessor value) => new Elastic.Clients.Elasticsearch.Ingest.Processor { Cef = value }; public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(Elastic.Clients.Elasticsearch.Ingest.CircleProcessor value) => new Elastic.Clients.Elasticsearch.Ingest.Processor { Circle = value }; public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(Elastic.Clients.Elasticsearch.Ingest.CommunityIDProcessor value) => new Elastic.Clients.Elasticsearch.Ingest.Processor { CommunityId = value }; public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(Elastic.Clients.Elasticsearch.Ingest.ConvertProcessor value) => new Elastic.Clients.Elasticsearch.Ingest.Processor { Convert = value }; @@ -561,6 +569,28 @@ public Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor Bytes return this; } + /// + /// + /// Converts a CEF message into a structured format. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor Cef(Elastic.Clients.Elasticsearch.Ingest.CefProcessor? value) + { + Instance.Cef = value; + return this; + } + + /// + /// + /// Converts a CEF message into a structured format. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor Cef(System.Action> action) + { + Instance.Cef = Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor.Build(action); + return this; + } + /// /// /// Converts circle definitions of shapes to regular polygons which approximate them. @@ -1082,7 +1112,7 @@ public Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor Join( /// /// - /// Converts a JSON string into a structured JSON object. + /// Parses a string containing JSON data into a structured object, string, or other value. /// /// public Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor Json(Elastic.Clients.Elasticsearch.Ingest.JsonProcessor? value) @@ -1093,7 +1123,7 @@ public Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor Json( /// /// - /// Converts a JSON string into a structured JSON object. + /// Parses a string containing JSON data into a structured object, string, or other value. /// /// public Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor Json(System.Action> action) @@ -1782,6 +1812,39 @@ public Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor Bytes(System. return this; } + /// + /// + /// Converts a CEF message into a structured format. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor Cef(Elastic.Clients.Elasticsearch.Ingest.CefProcessor? value) + { + Instance.Cef = value; + return this; + } + + /// + /// + /// Converts a CEF message into a structured format. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor Cef(System.Action action) + { + Instance.Cef = Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor.Build(action); + return this; + } + + /// + /// + /// Converts a CEF message into a structured format. + /// + /// + public Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor Cef(System.Action> action) + { + Instance.Cef = Elastic.Clients.Elasticsearch.Ingest.CefProcessorDescriptor.Build(action); + return this; + } + /// /// /// Converts circle definitions of shapes to regular polygons which approximate them. @@ -2550,7 +2613,7 @@ public Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor Join(System.A /// /// - /// Converts a JSON string into a structured JSON object. + /// Parses a string containing JSON data into a structured object, string, or other value. /// /// public Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor Json(Elastic.Clients.Elasticsearch.Ingest.JsonProcessor? value) @@ -2561,7 +2624,7 @@ public Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor Json(Elastic.Cli /// /// - /// Converts a JSON string into a structured JSON object. + /// Parses a string containing JSON data into a structured object, string, or other value. /// /// public Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor Json(System.Action action) @@ -2572,7 +2635,7 @@ public Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor Json(System.Acti /// /// - /// Converts a JSON string into a structured JSON object. + /// Parses a string containing JSON data into a structured object, string, or other value. /// /// public Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor Json(System.Action> action) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnSearch.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnSearch.Converters.g.cs index 8295ebe2328..1c6f6e147b5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnSearch.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnSearch.Converters.g.cs @@ -31,6 +31,7 @@ public sealed partial class KnnSearchConverter : System.Text.Json.Serialization. private static readonly System.Text.Json.JsonEncodedText PropInnerHits = System.Text.Json.JsonEncodedText.Encode("inner_hits"u8); private static readonly System.Text.Json.JsonEncodedText PropK = System.Text.Json.JsonEncodedText.Encode("k"u8); private static readonly System.Text.Json.JsonEncodedText PropNumCandidates = System.Text.Json.JsonEncodedText.Encode("num_candidates"u8); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"u8); private static readonly System.Text.Json.JsonEncodedText PropQueryVector = System.Text.Json.JsonEncodedText.Encode("query_vector"u8); private static readonly System.Text.Json.JsonEncodedText PropQueryVectorBuilder = System.Text.Json.JsonEncodedText.Encode("query_vector_builder"u8); private static readonly System.Text.Json.JsonEncodedText PropRescoreVector = System.Text.Json.JsonEncodedText.Encode("rescore_vector"u8); @@ -46,6 +47,7 @@ public override Elastic.Clients.Elasticsearch.KnnSearch Read(ref System.Text.Jso LocalJsonValue propInnerHits = default; LocalJsonValue propK = default; LocalJsonValue propNumCandidates = default; + LocalJsonValue propQueryName = default; LocalJsonValue?> propQueryVector = default; LocalJsonValue propQueryVectorBuilder = default; LocalJsonValue propRescoreVector = default; @@ -83,6 +85,11 @@ public override Elastic.Clients.Elasticsearch.KnnSearch Read(ref System.Text.Jso continue; } + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + if (propQueryVector.TryReadProperty(ref reader, options, PropQueryVector, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) { continue; @@ -126,6 +133,7 @@ public override Elastic.Clients.Elasticsearch.KnnSearch Read(ref System.Text.Jso InnerHits = propInnerHits.Value, K = propK.Value, NumCandidates = propNumCandidates.Value, + QueryName = propQueryName.Value, QueryVector = propQueryVector.Value, QueryVectorBuilder = propQueryVectorBuilder.Value, RescoreVector = propRescoreVector.Value, @@ -143,6 +151,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropInnerHits, value.InnerHits, null, null); writer.WriteProperty(options, PropK, value.K, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropNumCandidates, value.NumCandidates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); writer.WriteProperty(options, PropQueryVector, value.QueryVector, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); writer.WriteProperty(options, PropQueryVectorBuilder, value.QueryVectorBuilder, null, null); writer.WriteProperty(options, PropRescoreVector, value.RescoreVector, null, null); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnSearch.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnSearch.g.cs index a03aca67a10..20b69ffcb0f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnSearch.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnSearch.g.cs @@ -83,6 +83,7 @@ internal KnnSearch(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSe /// /// public int? NumCandidates { get; set; } + public string? QueryName { get; set; } /// /// @@ -266,6 +267,12 @@ public Elastic.Clients.Elasticsearch.KnnSearchDescriptor NumCandidate return this; } + public Elastic.Clients.Elasticsearch.KnnSearchDescriptor QueryName(string? value) + { + Instance.QueryName = value; + return this; + } + /// /// /// The query vector @@ -537,6 +544,12 @@ public Elastic.Clients.Elasticsearch.KnnSearchDescriptor NumCandidates(int? valu return this; } + public Elastic.Clients.Elasticsearch.KnnSearchDescriptor QueryName(string? value) + { + Instance.QueryName = value; + return this; + } + /// /// /// The query vector diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RawDocument.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LookupQueryVectorBuilder.Converters.g.cs similarity index 57% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RawDocument.Converters.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/LookupQueryVectorBuilder.Converters.g.cs index 3e3b4e9e49a..477b70e800c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RawDocument.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LookupQueryVectorBuilder.Converters.g.cs @@ -21,26 +21,40 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; +namespace Elastic.Clients.Elasticsearch.Json; -public sealed partial class RawDocumentConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class LookupQueryVectorBuilderConverter : System.Text.Json.Serialization.JsonConverter { + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"u8); private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"u8); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"u8); + private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"u8); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"u8); - public override Elastic.Clients.Elasticsearch.IndexManagement.RawDocument Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + public override Elastic.Clients.Elasticsearch.LookupQueryVectorBuilder Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; LocalJsonValue propIndex = default; - LocalJsonValue propSource = default; + LocalJsonValue propPath = default; + LocalJsonValue propRouting = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) { continue; } - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + if (propPath.TryReadProperty(ref reader, options, PropPath, null)) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) { continue; } @@ -55,18 +69,22 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.RawDocument Read(r } reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.RawDocument(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + return new Elastic.Clients.Elasticsearch.LookupQueryVectorBuilder(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { + Id = propId.Value, Index = propIndex.Value, - Source = propSource.Value + Path = propPath.Value, + Routing = propRouting.Value }; } - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RawDocument value, System.Text.Json.JsonSerializerOptions options) + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LookupQueryVectorBuilder value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteProperty(options, PropPath, value.Path, null, null); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/LookupQueryVectorBuilder.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LookupQueryVectorBuilder.g.cs new file mode 100644 index 00000000000..79f43aef902 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LookupQueryVectorBuilder.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.LookupQueryVectorBuilderConverter))] +public sealed partial class LookupQueryVectorBuilder +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public LookupQueryVectorBuilder(string id, string index, string path) + { + Id = id; + Index = index; + Path = path; + } + + public LookupQueryVectorBuilder() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal LookupQueryVectorBuilder(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// The ID of the document to fetch the vector from + /// + /// + public required string Id { get; set; } + + /// + /// + /// The name of the index to fetch the document from + /// + /// + public required string Index { get; set; } + + /// + /// + /// The name of the field containing the vector + /// + /// + public required string Path { get; set; } + + /// + /// + /// The routing value to use when fetching the document + /// + /// + public string? Routing { get; set; } +} + +public readonly partial struct LookupQueryVectorBuilderDescriptor +{ + internal Elastic.Clients.Elasticsearch.LookupQueryVectorBuilder Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public LookupQueryVectorBuilderDescriptor(Elastic.Clients.Elasticsearch.LookupQueryVectorBuilder instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public LookupQueryVectorBuilderDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.LookupQueryVectorBuilder(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.LookupQueryVectorBuilderDescriptor(Elastic.Clients.Elasticsearch.LookupQueryVectorBuilder instance) => new Elastic.Clients.Elasticsearch.LookupQueryVectorBuilderDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.LookupQueryVectorBuilder(Elastic.Clients.Elasticsearch.LookupQueryVectorBuilderDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// The ID of the document to fetch the vector from + /// + /// + public Elastic.Clients.Elasticsearch.LookupQueryVectorBuilderDescriptor Id(string value) + { + Instance.Id = value; + return this; + } + + /// + /// + /// The name of the index to fetch the document from + /// + /// + public Elastic.Clients.Elasticsearch.LookupQueryVectorBuilderDescriptor Index(string value) + { + Instance.Index = value; + return this; + } + + /// + /// + /// The name of the field containing the vector + /// + /// + public Elastic.Clients.Elasticsearch.LookupQueryVectorBuilderDescriptor Path(string value) + { + Instance.Path = value; + return this; + } + + /// + /// + /// The routing value to use when fetching the document + /// + /// + public Elastic.Clients.Elasticsearch.LookupQueryVectorBuilderDescriptor Routing(string? value) + { + Instance.Routing = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.LookupQueryVectorBuilder Build(System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.LookupQueryVectorBuilderDescriptor(new Elastic.Clients.Elasticsearch.LookupQueryVectorBuilder(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file 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 c8398d36b67..5453517c2a7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicTemplate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicTemplate.g.cs @@ -64,6 +64,7 @@ internal DynamicTemplate(Elastic.Clients.Elasticsearch.Serialization.JsonConstru public static implicit operator Elastic.Clients.Elasticsearch.Mapping.DynamicTemplate(Elastic.Clients.Elasticsearch.Mapping.DenseVectorProperty value) => new Elastic.Clients.Elasticsearch.Mapping.DynamicTemplate { Mapping = value }; public static implicit operator Elastic.Clients.Elasticsearch.Mapping.DynamicTemplate(Elastic.Clients.Elasticsearch.Mapping.DoubleNumberProperty value) => new Elastic.Clients.Elasticsearch.Mapping.DynamicTemplate { Mapping = value }; public static implicit operator Elastic.Clients.Elasticsearch.Mapping.DynamicTemplate(Elastic.Clients.Elasticsearch.Mapping.DoubleRangeProperty value) => new Elastic.Clients.Elasticsearch.Mapping.DynamicTemplate { Mapping = value }; + public static implicit operator Elastic.Clients.Elasticsearch.Mapping.DynamicTemplate(Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty value) => new Elastic.Clients.Elasticsearch.Mapping.DynamicTemplate { Mapping = value }; public static implicit operator Elastic.Clients.Elasticsearch.Mapping.DynamicTemplate(Elastic.Clients.Elasticsearch.Mapping.FlattenedProperty value) => new Elastic.Clients.Elasticsearch.Mapping.DynamicTemplate { Mapping = value }; public static implicit operator Elastic.Clients.Elasticsearch.Mapping.DynamicTemplate(Elastic.Clients.Elasticsearch.Mapping.FloatNumberProperty value) => new Elastic.Clients.Elasticsearch.Mapping.DynamicTemplate { Mapping = value }; public static implicit operator Elastic.Clients.Elasticsearch.Mapping.DynamicTemplate(Elastic.Clients.Elasticsearch.Mapping.FloatRangeProperty value) => new Elastic.Clients.Elasticsearch.Mapping.DynamicTemplate { Mapping = value }; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ExponentialHistogramProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ExponentialHistogramProperty.Converters.g.cs new file mode 100644 index 00000000000..e89c6fb03a9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ExponentialHistogramProperty.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class ExponentialHistogramPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"u8); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"u8); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"u8); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"u8); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"u8); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"u8); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"u8); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"u8); + + public override Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propProperties = default; + LocalJsonValue propSyntheticSourceKeep = default; + LocalJsonValue propTimeSeriesMetric = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.SafeSkip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + Meta = propMeta.Value, + Properties = propProperties.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value, + TimeSeriesMetric = propTimeSeriesMetric.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ExponentialHistogramProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ExponentialHistogramProperty.g.cs new file mode 100644 index 00000000000..56436b3a934 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ExponentialHistogramProperty.g.cs @@ -0,0 +1,308 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the 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.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.ExponentialHistogramPropertyConverter))] +public sealed partial class ExponentialHistogramProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty +{ + public ExponentialHistogramProperty() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal ExponentialHistogramProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? Dynamic { get; set; } + public Elastic.Clients.Elasticsearch.Mapping.Properties? Fields { get; set; } + public int? IgnoreAbove { get; set; } + + /// + /// + /// Metadata about the field. + /// + /// + public System.Collections.Generic.IDictionary? Meta { get; set; } + public Elastic.Clients.Elasticsearch.Mapping.Properties? Properties { get; set; } + public Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? SyntheticSourceKeep { get; set; } + public Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } + + public string Type => "exponential_histogram"; +} + +public readonly partial struct ExponentialHistogramPropertyDescriptor +{ + internal Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ExponentialHistogramPropertyDescriptor(Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ExponentialHistogramPropertyDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor(Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty instance) => new Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty(Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor descriptor) => descriptor.Instance; + + public Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? value) + { + Instance.Dynamic = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.Properties? value) + { + Instance.Fields = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor Fields(System.Action> action) + { + Instance.Fields = Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor.Build(action); + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor IgnoreAbove(int? value) + { + Instance.IgnoreAbove = value; + return this; + } + + /// + /// + /// Metadata about the field. + /// + /// + public Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor Meta(System.Collections.Generic.IDictionary? value) + { + Instance.Meta = value; + return this; + } + + /// + /// + /// Metadata about the field. + /// + /// + public Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor Meta() + { + Instance.Meta = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringString.Build(null); + return this; + } + + /// + /// + /// Metadata about the field. + /// + /// + public Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor Meta(System.Action? action) + { + Instance.Meta = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringString.Build(action); + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor AddMeta(string key, string value) + { + Instance.Meta ??= new System.Collections.Generic.Dictionary(); + Instance.Meta.Add(key, value); + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.Properties? value) + { + Instance.Properties = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor Properties(System.Action> action) + { + Instance.Properties = Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor.Build(action); + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor SyntheticSourceKeep(Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? value) + { + Instance.SyntheticSourceKeep = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? value) + { + Instance.TimeSeriesMetric = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty Build(System.Action>? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor(new Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} + +public readonly partial struct ExponentialHistogramPropertyDescriptor +{ + internal Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ExponentialHistogramPropertyDescriptor(Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ExponentialHistogramPropertyDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor(Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty instance) => new Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty(Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor descriptor) => descriptor.Instance; + + public Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? value) + { + Instance.Dynamic = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.Properties? value) + { + Instance.Fields = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor Fields(System.Action action) + { + Instance.Fields = Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor.Build(action); + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor Fields(System.Action> action) + { + Instance.Fields = Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor.Build(action); + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor IgnoreAbove(int? value) + { + Instance.IgnoreAbove = value; + return this; + } + + /// + /// + /// Metadata about the field. + /// + /// + public Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor Meta(System.Collections.Generic.IDictionary? value) + { + Instance.Meta = value; + return this; + } + + /// + /// + /// Metadata about the field. + /// + /// + public Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor Meta() + { + Instance.Meta = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringString.Build(null); + return this; + } + + /// + /// + /// Metadata about the field. + /// + /// + public Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor Meta(System.Action? action) + { + Instance.Meta = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringString.Build(action); + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor AddMeta(string key, string value) + { + Instance.Meta ??= new System.Collections.Generic.Dictionary(); + Instance.Meta.Add(key, value); + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.Properties? value) + { + Instance.Properties = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor Properties(System.Action action) + { + Instance.Properties = Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor.Build(action); + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor Properties(System.Action> action) + { + Instance.Properties = Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor.Build(action); + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor SyntheticSourceKeep(Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? value) + { + Instance.SyntheticSourceKeep = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? value) + { + Instance.TimeSeriesMetric = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor(new Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HistogramProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HistogramProperty.Converters.g.cs index da3301e9385..053cdc9a727 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HistogramProperty.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HistogramProperty.Converters.g.cs @@ -32,6 +32,7 @@ public sealed partial class HistogramPropertyConverter : System.Text.Json.Serial private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"u8); private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"u8); private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"u8); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"u8); private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"u8); public override Elastic.Clients.Elasticsearch.Mapping.HistogramProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) @@ -44,6 +45,7 @@ public override Elastic.Clients.Elasticsearch.Mapping.HistogramProperty Read(ref LocalJsonValue?> propMeta = default; LocalJsonValue propProperties = default; LocalJsonValue propSyntheticSourceKeep = default; + LocalJsonValue propTimeSeriesMetric = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) @@ -81,6 +83,11 @@ public override Elastic.Clients.Elasticsearch.Mapping.HistogramProperty Read(ref continue; } + if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + if (reader.ValueTextEquals(PropType)) { reader.SafeSkip(); @@ -105,7 +112,8 @@ public override Elastic.Clients.Elasticsearch.Mapping.HistogramProperty Read(ref IgnoreMalformed = propIgnoreMalformed.Value, Meta = propMeta.Value, Properties = propProperties.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value + SyntheticSourceKeep = propSyntheticSourceKeep.Value, + TimeSeriesMetric = propTimeSeriesMetric.Value }; } @@ -119,6 +127,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); writer.WriteProperty(options, PropProperties, value.Properties, null, null); writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); } 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 e390857c84e..35ce2e24b5b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HistogramProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HistogramProperty.g.cs @@ -49,6 +49,7 @@ internal HistogramProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConst public System.Collections.Generic.IDictionary? Meta { get; set; } public Elastic.Clients.Elasticsearch.Mapping.Properties? Properties { get; set; } public Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? SyntheticSourceKeep { get; set; } + public Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } public string Type => "histogram"; } @@ -160,6 +161,12 @@ public Elastic.Clients.Elasticsearch.Mapping.HistogramPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? value) + { + Instance.TimeSeriesMetric = value; + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.Mapping.HistogramProperty Build(System.Action>? action) { @@ -293,6 +300,12 @@ public Elastic.Clients.Elasticsearch.Mapping.HistogramPropertyDescriptor Synthet return this; } + public Elastic.Clients.Elasticsearch.Mapping.HistogramPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? value) + { + Instance.TimeSeriesMetric = value; + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.Mapping.HistogramProperty Build(System.Action? action) { 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 1cb2477c42b..7332334b70b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Properties.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Properties.g.cs @@ -587,6 +587,42 @@ public Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor Dou return this; } + public Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor ExponentialHistogram(Elastic.Clients.Elasticsearch.PropertyName key, Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty value) + { + _items.Add(key, value); + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor ExponentialHistogram(System.Linq.Expressions.Expression> key, Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty value) + { + _items.Add(key, value); + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor ExponentialHistogram(Elastic.Clients.Elasticsearch.PropertyName key) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor.Build(null)); + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor ExponentialHistogram(System.Linq.Expressions.Expression> key) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor.Build(null)); + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor ExponentialHistogram(Elastic.Clients.Elasticsearch.PropertyName key, System.Action>? action) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor.Build(action)); + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor ExponentialHistogram(System.Linq.Expressions.Expression> key, System.Action>? action) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor.Build(action)); + return this; + } + public Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor Flattened(Elastic.Clients.Elasticsearch.PropertyName key, Elastic.Clients.Elasticsearch.Mapping.FlattenedProperty value) { _items.Add(key, value); @@ -2651,6 +2687,54 @@ public Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor DoubleRange return this; } + public Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor ExponentialHistogram(Elastic.Clients.Elasticsearch.PropertyName key, Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty value) + { + _items.Add(key, value); + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor ExponentialHistogram(System.Linq.Expressions.Expression> key, Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty value) + { + _items.Add(key, value); + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor ExponentialHistogram(Elastic.Clients.Elasticsearch.PropertyName key) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor.Build(null)); + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor ExponentialHistogram(System.Linq.Expressions.Expression> key) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor.Build(null)); + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor ExponentialHistogram(Elastic.Clients.Elasticsearch.PropertyName key, System.Action? action) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor.Build(action)); + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor ExponentialHistogram(System.Linq.Expressions.Expression> key, System.Action? action) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor.Build(action)); + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor ExponentialHistogram(Elastic.Clients.Elasticsearch.PropertyName key, System.Action>? action) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor.Build(action)); + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor ExponentialHistogram(System.Linq.Expressions.Expression> key, System.Action>? action) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor.Build(action)); + return this; + } + public Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor Flattened(Elastic.Clients.Elasticsearch.PropertyName key, Elastic.Clients.Elasticsearch.Mapping.FlattenedProperty value) { _items.Add(key, value); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Property.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Property.Converters.g.cs index 28f0b5a01ab..74f170ec041 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Property.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Property.Converters.g.cs @@ -60,6 +60,7 @@ public override Elastic.Clients.Elasticsearch.Mapping.IProperty Read(ref System. "dense_vector" => reader.ReadValue(options, null), "double" => reader.ReadValue(options, null), "double_range" => reader.ReadValue(options, null), + "exponential_histogram" => reader.ReadValue(options, null), "flattened" => reader.ReadValue(options, null), "float" => reader.ReadValue(options, null), "float_range" => reader.ReadValue(options, null), @@ -150,6 +151,9 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien case "double_range": writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.DoubleRangeProperty)value, null); break; + case "exponential_histogram": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty)value, null); + break; case "flattened": writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.FlattenedProperty)value, null); break; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Property.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Property.g.cs index 8c2cfe9ab6c..7751bfe27a9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Property.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Property.g.cs @@ -251,6 +251,21 @@ public Elastic.Clients.Elasticsearch.Mapping.IProperty DoubleRange(System.Action return Elastic.Clients.Elasticsearch.Mapping.DoubleRangePropertyDescriptor.Build(action); } + public Elastic.Clients.Elasticsearch.Mapping.IProperty ExponentialHistogram(Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty value) + { + return value; + } + + public Elastic.Clients.Elasticsearch.Mapping.IProperty ExponentialHistogram() + { + return Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor.Build(null); + } + + public Elastic.Clients.Elasticsearch.Mapping.IProperty ExponentialHistogram(System.Action>? action) + { + return Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor.Build(action); + } + public Elastic.Clients.Elasticsearch.Mapping.IProperty Flattened(Elastic.Clients.Elasticsearch.Mapping.FlattenedProperty value) { return value; @@ -1111,6 +1126,26 @@ public Elastic.Clients.Elasticsearch.Mapping.IProperty DoubleRange(System.Act return Elastic.Clients.Elasticsearch.Mapping.DoubleRangePropertyDescriptor.Build(action); } + public Elastic.Clients.Elasticsearch.Mapping.IProperty ExponentialHistogram(Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramProperty value) + { + return value; + } + + public Elastic.Clients.Elasticsearch.Mapping.IProperty ExponentialHistogram() + { + return Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor.Build(null); + } + + public Elastic.Clients.Elasticsearch.Mapping.IProperty ExponentialHistogram(System.Action? action) + { + return Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor.Build(action); + } + + public Elastic.Clients.Elasticsearch.Mapping.IProperty ExponentialHistogram(System.Action>? action) + { + return Elastic.Clients.Elasticsearch.Mapping.ExponentialHistogramPropertyDescriptor.Build(action); + } + public Elastic.Clients.Elasticsearch.Mapping.IProperty Flattened(Elastic.Clients.Elasticsearch.Mapping.FlattenedProperty value) { return value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeUsage.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeUsage.g.cs index 70fcf96eace..9a6c629edcd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeUsage.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeUsage.g.cs @@ -45,8 +45,32 @@ internal NodeUsage(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSe _ = sentinel; } + /// + /// + /// The total number of times search aggregations have been called on this node since the last restart. + /// + /// public required System.Collections.Generic.IReadOnlyDictionary Aggregations { get; set; } + + /// + /// + /// The total number of times each REST endpoint has been called on this node since the last restart. + /// Note that the REST endpoint names are not considered stable. + /// + /// public required System.Collections.Generic.IReadOnlyDictionary RestActions { get; set; } + + /// + /// + /// The timestamp for when the collection of these statistics started. + /// + /// public required System.DateTimeOffset Since { get; set; } + + /// + /// + /// The timestamp for when these statistics were collected. + /// + /// public required System.DateTimeOffset Timestamp { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Project/ProjectRoutingExpression.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Project/ProjectRoutingExpression.Converters.g.cs new file mode 100644 index 00000000000..019209a6da8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Project/ProjectRoutingExpression.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Project.Json; + +public sealed partial class ProjectRoutingExpressionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExpression = System.Text.Json.JsonEncodedText.Encode("expression"u8); + + public override Elastic.Clients.Elasticsearch.Project.ProjectRoutingExpression Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExpression = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExpression.TryReadProperty(ref reader, options, PropExpression, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Project.ProjectRoutingExpression(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Expression = propExpression.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Project.ProjectRoutingExpression value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExpression, value.Expression, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Project/ProjectRoutingExpression.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Project/ProjectRoutingExpression.g.cs new file mode 100644 index 00000000000..659c6ba3fee --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Project/ProjectRoutingExpression.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Project; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Project.Json.ProjectRoutingExpressionConverter))] +public sealed partial class ProjectRoutingExpression +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ProjectRoutingExpression(string expression) + { + Expression = expression; + } + + public ProjectRoutingExpression() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal ProjectRoutingExpression(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public required string Expression { get; set; } +} + +public readonly partial struct ProjectRoutingExpressionDescriptor +{ + internal Elastic.Clients.Elasticsearch.Project.ProjectRoutingExpression Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ProjectRoutingExpressionDescriptor(Elastic.Clients.Elasticsearch.Project.ProjectRoutingExpression instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ProjectRoutingExpressionDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Project.ProjectRoutingExpression(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Project.ProjectRoutingExpressionDescriptor(Elastic.Clients.Elasticsearch.Project.ProjectRoutingExpression instance) => new Elastic.Clients.Elasticsearch.Project.ProjectRoutingExpressionDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Project.ProjectRoutingExpression(Elastic.Clients.Elasticsearch.Project.ProjectRoutingExpressionDescriptor descriptor) => descriptor.Instance; + + public Elastic.Clients.Elasticsearch.Project.ProjectRoutingExpressionDescriptor Expression(string value) + { + Instance.Expression = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Project.ProjectRoutingExpression Build(System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Project.ProjectRoutingExpressionDescriptor(new Elastic.Clients.Elasticsearch.Project.ProjectRoutingExpression(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldLookup.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldLookup.Converters.g.cs index 2a8af15e64b..8c9c5380239 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldLookup.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldLookup.Converters.g.cs @@ -36,7 +36,7 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.FieldLookup Read(ref Syst LocalJsonValue propId = default; LocalJsonValue propIndex = default; LocalJsonValue propPath = default; - LocalJsonValue propRouting = default; + LocalJsonValue propRouting = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propId.TryReadProperty(ref reader, options, PropId, null)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldLookup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldLookup.g.cs index 3ac3c5ee9a7..282ec38f57f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldLookup.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldLookup.g.cs @@ -68,7 +68,7 @@ internal FieldLookup(Elastic.Clients.Elasticsearch.Serialization.JsonConstructor /// Custom routing value. /// /// - public Elastic.Clients.Elasticsearch.Routing? Routing { get; set; } + public string? Routing { get; set; } } public readonly partial struct FieldLookupDescriptor @@ -139,7 +139,7 @@ public Elastic.Clients.Elasticsearch.QueryDsl.FieldLookupDescriptor P /// Custom routing value. /// /// - public Elastic.Clients.Elasticsearch.QueryDsl.FieldLookupDescriptor Routing(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.QueryDsl.FieldLookupDescriptor Routing(string? value) { Instance.Routing = value; return this; @@ -222,7 +222,7 @@ public Elastic.Clients.Elasticsearch.QueryDsl.FieldLookupDescriptor Path(Syst /// Custom routing value. /// /// - public Elastic.Clients.Elasticsearch.QueryDsl.FieldLookupDescriptor Routing(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.QueryDsl.FieldLookupDescriptor Routing(string? value) { Instance.Routing = value; return this; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScore.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScore.Converters.g.cs index a5a7bbe3d99..9aa01f86145 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScore.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScore.Converters.g.cs @@ -26,6 +26,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; public sealed partial class FunctionScoreConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"u8); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("_name"u8); private static readonly System.Text.Json.JsonEncodedText PropWeight = System.Text.Json.JsonEncodedText.Encode("weight"u8); private static readonly System.Text.Json.JsonEncodedText VariantExp = System.Text.Json.JsonEncodedText.Encode("exp"); private static readonly System.Text.Json.JsonEncodedText VariantFieldValueFactor = System.Text.Json.JsonEncodedText.Encode("field_value_factor"); @@ -38,6 +39,7 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.FunctionScore Read(ref Sy { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propFilter = default; + LocalJsonValue propName = default; LocalJsonValue propWeight = default; string? variantType = null; object? variant = null; @@ -48,6 +50,11 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.FunctionScore Read(ref Sy continue; } + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + if (propWeight.TryReadProperty(ref reader, options, PropWeight, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) { continue; @@ -116,6 +123,7 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.FunctionScore Read(ref Sy VariantType = variantType, Variant = variant, Filter = propFilter.Value, + Name = propName.Value, Weight = propWeight.Value }; } @@ -150,6 +158,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien } writer.WriteProperty(options, PropFilter, value.Filter, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); writer.WriteProperty(options, PropWeight, value.Weight, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); writer.WriteEndObject(); } 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 83d689fe923..d904cc9b2ed 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScore.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScore.g.cs @@ -83,6 +83,13 @@ internal FunctionScore(Elastic.Clients.Elasticsearch.Serialization.JsonConstruct /// public Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreFunction? ScriptScore { get => GetVariant("script_score"); set => SetVariant("script_score", value); } public Elastic.Clients.Elasticsearch.QueryDsl.Query? Filter { get; set; } + + /// + /// + /// A name to identify which function matched and influenced the score. + /// + /// + public string? Name { get; set; } public double? Weight { get; set; } public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.FunctionScore(Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorScoreFunction value) => new Elastic.Clients.Elasticsearch.QueryDsl.FunctionScore { FieldValueFactor = value }; @@ -287,6 +294,17 @@ public Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreDescriptor return this; } + /// + /// + /// A name to identify which function matched and influenced the score. + /// + /// + public Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreDescriptor Name(string? value) + { + Instance.Name = value; + return this; + } + public Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreDescriptor Weight(double? value) { Instance.Weight = value; @@ -544,6 +562,17 @@ public Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreDescriptor Filter( return this; } + /// + /// + /// A name to identify which function matched and influenced the score. + /// + /// + public Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreDescriptor Name(string? value) + { + Instance.Name = value; + return this; + } + public Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreDescriptor Weight(double? value) { Instance.Weight = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MoreLikeThisQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MoreLikeThisQuery.Converters.g.cs index 8c59e929681..718a7830a60 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MoreLikeThisQuery.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MoreLikeThisQuery.Converters.g.cs @@ -64,7 +64,7 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQuery Read(re LocalJsonValue propMinTermFreq = default; LocalJsonValue propMinWordLength = default; LocalJsonValue propQueryName = default; - LocalJsonValue propRouting = default; + LocalJsonValue propRouting = default; LocalJsonValue>?> propStopWords = default; LocalJsonValue?> propUnlike = default; LocalJsonValue propVersion = default; 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 4af8182801b..4ad8bf4c610 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MoreLikeThisQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MoreLikeThisQuery.g.cs @@ -148,7 +148,7 @@ internal MoreLikeThisQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// public int? MinWordLength { get; set; } public string? QueryName { get; set; } - public Elastic.Clients.Elasticsearch.Routing? Routing { get; set; } + public string? Routing { get; set; } /// /// @@ -395,7 +395,7 @@ public Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQueryDescriptor Routing(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQueryDescriptor Routing(string? value) { Instance.Routing = value; return this; @@ -717,7 +717,7 @@ public Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQueryDescriptor QueryN return this; } - public Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQueryDescriptor Routing(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQueryDescriptor Routing(string? value) { Instance.Routing = value; return this; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PercolateQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PercolateQuery.Converters.g.cs index fb28dd538b8..9f968e2fd59 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PercolateQuery.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PercolateQuery.Converters.g.cs @@ -49,7 +49,7 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.PercolateQuery Read(ref S LocalJsonValue propName = default; LocalJsonValue propPreference = default; LocalJsonValue propQueryName = default; - LocalJsonValue propRouting = default; + LocalJsonValue propRouting = default; LocalJsonValue propVersion = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { 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 88b9860ba10..4446ffc53bc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PercolateQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PercolateQuery.g.cs @@ -107,7 +107,7 @@ internal PercolateQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstruc /// Routing used to fetch document to percolate. /// /// - public Elastic.Clients.Elasticsearch.Routing? Routing { get; set; } + public string? Routing { get; set; } /// /// @@ -260,7 +260,7 @@ public Elastic.Clients.Elasticsearch.QueryDsl.PercolateQueryDescriptor /// - public Elastic.Clients.Elasticsearch.QueryDsl.PercolateQueryDescriptor Routing(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.QueryDsl.PercolateQueryDescriptor Routing(string? value) { Instance.Routing = value; return this; @@ -429,7 +429,7 @@ public Elastic.Clients.Elasticsearch.QueryDsl.PercolateQueryDescriptor QueryName /// Routing used to fetch document to percolate. /// /// - public Elastic.Clients.Elasticsearch.QueryDsl.PercolateQueryDescriptor Routing(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.QueryDsl.PercolateQueryDescriptor Routing(string? value) { Instance.Routing = value; return this; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SparseVectorQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SparseVectorQuery.Converters.g.cs index 8e74553f225..349e3026973 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SparseVectorQuery.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SparseVectorQuery.Converters.g.cs @@ -32,6 +32,7 @@ public sealed partial class SparseVectorQueryConverter : System.Text.Json.Serial private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"u8); private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"u8); private static readonly System.Text.Json.JsonEncodedText VariantInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText VariantQueryVector = System.Text.Json.JsonEncodedText.Encode("query_vector"); public override Elastic.Clients.Elasticsearch.QueryDsl.SparseVectorQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { @@ -84,6 +85,14 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.SparseVectorQuery Read(re continue; } + if (reader.ValueTextEquals(VariantQueryVector)) + { + variantType = VariantQueryVector.Value; + reader.Read(); + variant = reader.ReadValue>(options, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!); + continue; + } + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) { reader.SafeSkip(); @@ -117,6 +126,9 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien case "inference_id": writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Id)value.Variant, null, null); break; + case "query_vector": + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IDictionary)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + break; default: throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.SparseVectorQuery)}'."); } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SparseVectorQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SparseVectorQuery.g.cs index 9514eed45ea..66a871cd36f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SparseVectorQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SparseVectorQuery.g.cs @@ -56,6 +56,14 @@ internal SparseVectorQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// public Elastic.Clients.Elasticsearch.Id? InferenceId { get => GetVariant("inference_id"); set => SetVariant("inference_id", value); } + /// + /// + /// Dictionary of precomputed sparse vectors and their associated weights. + /// Only one of inference_id or query_vector may be supplied in a request. + /// + /// + public System.Collections.Generic.IDictionary? QueryVector { get => GetVariant>("query_vector"); set => SetVariant("query_vector", value); } + /// /// /// Floating point number used to decrease or increase the relevance scores of the query. @@ -155,6 +163,49 @@ public Elastic.Clients.Elasticsearch.QueryDsl.SparseVectorQueryDescriptor + /// + /// Dictionary of precomputed sparse vectors and their associated weights. + /// Only one of inference_id or query_vector may be supplied in a request. + /// + /// + public Elastic.Clients.Elasticsearch.QueryDsl.SparseVectorQueryDescriptor QueryVector(System.Collections.Generic.IDictionary? value) + { + Instance.QueryVector = value; + return this; + } + + /// + /// + /// Dictionary of precomputed sparse vectors and their associated weights. + /// Only one of inference_id or query_vector may be supplied in a request. + /// + /// + public Elastic.Clients.Elasticsearch.QueryDsl.SparseVectorQueryDescriptor QueryVector() + { + Instance.QueryVector = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringFloat.Build(null); + return this; + } + + /// + /// + /// Dictionary of precomputed sparse vectors and their associated weights. + /// Only one of inference_id or query_vector may be supplied in a request. + /// + /// + public Elastic.Clients.Elasticsearch.QueryDsl.SparseVectorQueryDescriptor QueryVector(System.Action? action) + { + Instance.QueryVector = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringFloat.Build(action); + return this; + } + + public Elastic.Clients.Elasticsearch.QueryDsl.SparseVectorQueryDescriptor AddQueryVector(string key, float value) + { + Instance.QueryVector ??= new System.Collections.Generic.Dictionary(); + Instance.QueryVector.Add(key, value); + return this; + } + /// /// /// Floating point number used to decrease or increase the relevance scores of the query. @@ -309,6 +360,49 @@ public Elastic.Clients.Elasticsearch.QueryDsl.SparseVectorQueryDescriptor Infere return this; } + /// + /// + /// Dictionary of precomputed sparse vectors and their associated weights. + /// Only one of inference_id or query_vector may be supplied in a request. + /// + /// + public Elastic.Clients.Elasticsearch.QueryDsl.SparseVectorQueryDescriptor QueryVector(System.Collections.Generic.IDictionary? value) + { + Instance.QueryVector = value; + return this; + } + + /// + /// + /// Dictionary of precomputed sparse vectors and their associated weights. + /// Only one of inference_id or query_vector may be supplied in a request. + /// + /// + public Elastic.Clients.Elasticsearch.QueryDsl.SparseVectorQueryDescriptor QueryVector() + { + Instance.QueryVector = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringFloat.Build(null); + return this; + } + + /// + /// + /// Dictionary of precomputed sparse vectors and their associated weights. + /// Only one of inference_id or query_vector may be supplied in a request. + /// + /// + public Elastic.Clients.Elasticsearch.QueryDsl.SparseVectorQueryDescriptor QueryVector(System.Action? action) + { + Instance.QueryVector = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringFloat.Build(action); + return this; + } + + public Elastic.Clients.Elasticsearch.QueryDsl.SparseVectorQueryDescriptor AddQueryVector(string key, float value) + { + Instance.QueryVector ??= new System.Collections.Generic.Dictionary(); + Instance.QueryVector.Add(key, value); + return this; + } + /// /// /// Floating point number used to decrease or increase the relevance scores of the query. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsLookup.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsLookup.Converters.g.cs index 8d065271105..fbfcd91d568 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsLookup.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsLookup.Converters.g.cs @@ -36,7 +36,7 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.TermsLookup Read(ref Syst LocalJsonValue propId = default; LocalJsonValue propIndex = default; LocalJsonValue propPath = default; - LocalJsonValue propRouting = default; + LocalJsonValue propRouting = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propId.TryReadProperty(ref reader, options, PropId, null)) 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 235e320fa05..0474eff148d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsLookup.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsLookup.g.cs @@ -47,7 +47,7 @@ internal TermsLookup(Elastic.Clients.Elasticsearch.Serialization.JsonConstructor public required Elastic.Clients.Elasticsearch.Id Id { get; set; } public required Elastic.Clients.Elasticsearch.IndexName Index { get; set; } public required Elastic.Clients.Elasticsearch.Field Path { get; set; } - public Elastic.Clients.Elasticsearch.Routing? Routing { get; set; } + public string? Routing { get; set; } } public readonly partial struct TermsLookupDescriptor @@ -93,7 +93,7 @@ public Elastic.Clients.Elasticsearch.QueryDsl.TermsLookupDescriptor P return this; } - public Elastic.Clients.Elasticsearch.QueryDsl.TermsLookupDescriptor Routing(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.QueryDsl.TermsLookupDescriptor Routing(string? value) { Instance.Routing = value; return this; @@ -151,7 +151,7 @@ public Elastic.Clients.Elasticsearch.QueryDsl.TermsLookupDescriptor Path(Syst return this; } - public Elastic.Clients.Elasticsearch.QueryDsl.TermsLookupDescriptor Routing(Elastic.Clients.Elasticsearch.Routing? value) + public Elastic.Clients.Elasticsearch.QueryDsl.TermsLookupDescriptor Routing(string? value) { Instance.Routing = value; return this; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleCriteriaType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleCriteriaType.Converters.g.cs index fb77031bc33..f92935bfd4a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleCriteriaType.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleCriteriaType.Converters.g.cs @@ -28,7 +28,6 @@ public sealed partial class QueryRuleCriteriaTypeConverter : System.Text.Json.Se private static readonly System.Text.Json.JsonEncodedText MemberAlways = System.Text.Json.JsonEncodedText.Encode("always"u8); private static readonly System.Text.Json.JsonEncodedText MemberContains = System.Text.Json.JsonEncodedText.Encode("contains"u8); private static readonly System.Text.Json.JsonEncodedText MemberExact = System.Text.Json.JsonEncodedText.Encode("exact"u8); - private static readonly System.Text.Json.JsonEncodedText MemberExactFuzzy = System.Text.Json.JsonEncodedText.Encode("exact_fuzzy"u8); private static readonly System.Text.Json.JsonEncodedText MemberFuzzy = System.Text.Json.JsonEncodedText.Encode("fuzzy"u8); private static readonly System.Text.Json.JsonEncodedText MemberGlobal = System.Text.Json.JsonEncodedText.Encode("global"u8); private static readonly System.Text.Json.JsonEncodedText MemberGt = System.Text.Json.JsonEncodedText.Encode("gt"u8); @@ -55,11 +54,6 @@ public override Elastic.Clients.Elasticsearch.QueryRules.QueryRuleCriteriaType R return Elastic.Clients.Elasticsearch.QueryRules.QueryRuleCriteriaType.Exact; } - if (reader.ValueTextEquals(MemberExactFuzzy)) - { - return Elastic.Clients.Elasticsearch.QueryRules.QueryRuleCriteriaType.ExactFuzzy; - } - if (reader.ValueTextEquals(MemberFuzzy)) { return Elastic.Clients.Elasticsearch.QueryRules.QueryRuleCriteriaType.Fuzzy; @@ -116,11 +110,6 @@ public override Elastic.Clients.Elasticsearch.QueryRules.QueryRuleCriteriaType R return Elastic.Clients.Elasticsearch.QueryRules.QueryRuleCriteriaType.Exact; } - if (string.Equals(value, MemberExactFuzzy.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryRules.QueryRuleCriteriaType.ExactFuzzy; - } - if (string.Equals(value, MemberFuzzy.Value, System.StringComparison.OrdinalIgnoreCase)) { return Elastic.Clients.Elasticsearch.QueryRules.QueryRuleCriteriaType.Fuzzy; @@ -177,9 +166,6 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien case Elastic.Clients.Elasticsearch.QueryRules.QueryRuleCriteriaType.Exact: writer.WriteStringValue(MemberExact); break; - case Elastic.Clients.Elasticsearch.QueryRules.QueryRuleCriteriaType.ExactFuzzy: - writer.WriteStringValue(MemberExactFuzzy); - break; case Elastic.Clients.Elasticsearch.QueryRules.QueryRuleCriteriaType.Fuzzy: writer.WriteStringValue(MemberFuzzy); break; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleCriteriaType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleCriteriaType.g.cs index 32bef61862b..04115f7858d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleCriteriaType.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleCriteriaType.g.cs @@ -32,8 +32,6 @@ public enum QueryRuleCriteriaType Contains, [System.Runtime.Serialization.EnumMember(Value = "exact")] Exact, - [System.Runtime.Serialization.EnumMember(Value = "exact_fuzzy")] - ExactFuzzy, [System.Runtime.Serialization.EnumMember(Value = "fuzzy")] Fuzzy, [System.Runtime.Serialization.EnumMember(Value = "global")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.Converters.g.cs index 08d95fe0ff9..806a6c25779 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.Converters.g.cs @@ -25,6 +25,7 @@ namespace Elastic.Clients.Elasticsearch.Json; public sealed partial class QueryVectorBuilderConverter : System.Text.Json.Serialization.JsonConverter { + private static readonly System.Text.Json.JsonEncodedText VariantLookup = System.Text.Json.JsonEncodedText.Encode("lookup"); private static readonly System.Text.Json.JsonEncodedText VariantTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); public override Elastic.Clients.Elasticsearch.QueryVectorBuilder Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) @@ -34,6 +35,14 @@ public override Elastic.Clients.Elasticsearch.QueryVectorBuilder Read(ref System object? variant = null; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { + if (reader.ValueTextEquals(VariantLookup)) + { + variantType = VariantLookup.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + if (reader.ValueTextEquals(VariantTextEmbedding)) { variantType = VariantTextEmbedding.Value; @@ -66,6 +75,9 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { case null: break; + case "lookup": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.LookupQueryVectorBuilder)value.Variant, null, null); + break; case "text_embedding": writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.TextEmbedding)value.Variant, null, null); break; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.g.cs index 0bb2a08ed52..d6254f1ab2a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.g.cs @@ -39,8 +39,16 @@ internal QueryVectorBuilder(Elastic.Clients.Elasticsearch.Serialization.JsonCons _ = sentinel; } + /// + /// + /// Lookup a vector from an existing document. + /// Must reference a dense_vector field and a single value. + /// + /// + public Elastic.Clients.Elasticsearch.LookupQueryVectorBuilder? Lookup { get => GetVariant("lookup"); set => SetVariant("lookup", value); } public Elastic.Clients.Elasticsearch.TextEmbedding? TextEmbedding { get => GetVariant("text_embedding"); set => SetVariant("text_embedding", value); } + public static implicit operator Elastic.Clients.Elasticsearch.QueryVectorBuilder(Elastic.Clients.Elasticsearch.LookupQueryVectorBuilder value) => new Elastic.Clients.Elasticsearch.QueryVectorBuilder { Lookup = value }; public static implicit operator Elastic.Clients.Elasticsearch.QueryVectorBuilder(Elastic.Clients.Elasticsearch.TextEmbedding value) => new Elastic.Clients.Elasticsearch.QueryVectorBuilder { TextEmbedding = value }; [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] @@ -81,6 +89,30 @@ public QueryVectorBuilderDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.QueryVectorBuilderDescriptor(Elastic.Clients.Elasticsearch.QueryVectorBuilder instance) => new Elastic.Clients.Elasticsearch.QueryVectorBuilderDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.QueryVectorBuilder(Elastic.Clients.Elasticsearch.QueryVectorBuilderDescriptor descriptor) => descriptor.Instance; + /// + /// + /// Lookup a vector from an existing document. + /// Must reference a dense_vector field and a single value. + /// + /// + public Elastic.Clients.Elasticsearch.QueryVectorBuilderDescriptor Lookup(Elastic.Clients.Elasticsearch.LookupQueryVectorBuilder? value) + { + Instance.Lookup = value; + return this; + } + + /// + /// + /// Lookup a vector from an existing document. + /// Must reference a dense_vector field and a single value. + /// + /// + public Elastic.Clients.Elasticsearch.QueryVectorBuilderDescriptor Lookup(System.Action action) + { + Instance.Lookup = Elastic.Clients.Elasticsearch.LookupQueryVectorBuilderDescriptor.Build(action); + return this; + } + public Elastic.Clients.Elasticsearch.QueryVectorBuilderDescriptor TextEmbedding(Elastic.Clients.Elasticsearch.TextEmbedding? value) { Instance.TextEmbedding = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexStatus.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ReindexStatus.Converters.g.cs similarity index 79% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexStatus.Converters.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/ReindexStatus.Converters.g.cs index 1f580ae0e66..e18075ae873 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexStatus.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ReindexStatus.Converters.g.cs @@ -21,16 +21,18 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.Json; +namespace Elastic.Clients.Elasticsearch.Json; -public sealed partial class ReindexStatusConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class ReindexStatusConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropBatches = System.Text.Json.JsonEncodedText.Encode("batches"u8); + private static readonly System.Text.Json.JsonEncodedText PropCancelled = System.Text.Json.JsonEncodedText.Encode("cancelled"u8); private static readonly System.Text.Json.JsonEncodedText PropCreated = System.Text.Json.JsonEncodedText.Encode("created"u8); private static readonly System.Text.Json.JsonEncodedText PropDeleted = System.Text.Json.JsonEncodedText.Encode("deleted"u8); private static readonly System.Text.Json.JsonEncodedText PropNoops = System.Text.Json.JsonEncodedText.Encode("noops"u8); private static readonly System.Text.Json.JsonEncodedText PropRequestsPerSecond = System.Text.Json.JsonEncodedText.Encode("requests_per_second"u8); private static readonly System.Text.Json.JsonEncodedText PropRetries = System.Text.Json.JsonEncodedText.Encode("retries"u8); + private static readonly System.Text.Json.JsonEncodedText PropSliceId = System.Text.Json.JsonEncodedText.Encode("slice_id"u8); private static readonly System.Text.Json.JsonEncodedText PropThrottled = System.Text.Json.JsonEncodedText.Encode("throttled"u8); private static readonly System.Text.Json.JsonEncodedText PropThrottledMillis = System.Text.Json.JsonEncodedText.Encode("throttled_millis"u8); private static readonly System.Text.Json.JsonEncodedText PropThrottledUntil = System.Text.Json.JsonEncodedText.Encode("throttled_until"u8); @@ -39,21 +41,23 @@ public sealed partial class ReindexStatusConverter : System.Text.Json.Serializat private static readonly System.Text.Json.JsonEncodedText PropUpdated = System.Text.Json.JsonEncodedText.Encode("updated"u8); private static readonly System.Text.Json.JsonEncodedText PropVersionConflicts = System.Text.Json.JsonEncodedText.Encode("version_conflicts"u8); - public override Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + public override Elastic.Clients.Elasticsearch.ReindexStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propBatches = default; - LocalJsonValue propCreated = default; + LocalJsonValue propCancelled = default; + LocalJsonValue propCreated = default; LocalJsonValue propDeleted = default; LocalJsonValue propNoops = default; LocalJsonValue propRequestsPerSecond = default; LocalJsonValue propRetries = default; + LocalJsonValue propSliceId = default; LocalJsonValue propThrottled = default; LocalJsonValue propThrottledMillis = default; LocalJsonValue propThrottledUntil = default; LocalJsonValue propThrottledUntilMillis = default; LocalJsonValue propTotal = default; - LocalJsonValue propUpdated = default; + LocalJsonValue propUpdated = default; LocalJsonValue propVersionConflicts = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -62,7 +66,12 @@ public override Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexStat continue; } - if (propCreated.TryReadProperty(ref reader, options, PropCreated, null)) + if (propCancelled.TryReadProperty(ref reader, options, PropCancelled, null)) + { + continue; + } + + if (propCreated.TryReadProperty(ref reader, options, PropCreated, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) { continue; } @@ -87,6 +96,11 @@ public override Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexStat continue; } + if (propSliceId.TryReadProperty(ref reader, options, PropSliceId, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + if (propThrottled.TryReadProperty(ref reader, options, PropThrottled, null)) { continue; @@ -112,7 +126,7 @@ public override Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexStat continue; } - if (propUpdated.TryReadProperty(ref reader, options, PropUpdated, null)) + if (propUpdated.TryReadProperty(ref reader, options, PropUpdated, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) { continue; } @@ -132,14 +146,16 @@ public override Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexStat } reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + return new Elastic.Clients.Elasticsearch.ReindexStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Batches = propBatches.Value, + Cancelled = propCancelled.Value, Created = propCreated.Value, Deleted = propDeleted.Value, Noops = propNoops.Value, RequestsPerSecond = propRequestsPerSecond.Value, Retries = propRetries.Value, + SliceId = propSliceId.Value, Throttled = propThrottled.Value, ThrottledMillis = propThrottledMillis.Value, ThrottledUntil = propThrottledUntil.Value, @@ -150,21 +166,23 @@ public override Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexStat }; } - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexStatus value, System.Text.Json.JsonSerializerOptions options) + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ReindexStatus value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); writer.WriteProperty(options, PropBatches, value.Batches, null, null); - writer.WriteProperty(options, PropCreated, value.Created, null, null); + writer.WriteProperty(options, PropCancelled, value.Cancelled, null, null); + writer.WriteProperty(options, PropCreated, value.Created, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropDeleted, value.Deleted, null, null); writer.WriteProperty(options, PropNoops, value.Noops, null, null); writer.WriteProperty(options, PropRequestsPerSecond, value.RequestsPerSecond, null, null); writer.WriteProperty(options, PropRetries, value.Retries, null, null); + writer.WriteProperty(options, PropSliceId, value.SliceId, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropThrottled, value.Throttled, null, null); writer.WriteProperty(options, PropThrottledMillis, value.ThrottledMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); writer.WriteProperty(options, PropThrottledUntil, value.ThrottledUntil, null, null); writer.WriteProperty(options, PropThrottledUntilMillis, value.ThrottledUntilMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteProperty(options, PropUpdated, value.Updated, null, null); + writer.WriteProperty(options, PropUpdated, value.Updated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropVersionConflicts, value.VersionConflicts, null, null); writer.WriteEndObject(); } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ReindexStatus.g.cs similarity index 86% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexStatus.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/ReindexStatus.g.cs index c9324345558..daae83c3f77 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexStatus.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ReindexStatus.g.cs @@ -21,16 +21,15 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.Core.ReindexRethrottle; +namespace Elastic.Clients.Elasticsearch; -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.Json.ReindexStatusConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ReindexStatusConverter))] public sealed partial class ReindexStatus { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public ReindexStatus(long batches, long created, long deleted, long noops, float requestsPerSecond, Elastic.Clients.Elasticsearch.Retries retries, System.TimeSpan throttledMillis, System.TimeSpan throttledUntilMillis, long total, long updated, long versionConflicts) + public ReindexStatus(long batches, long deleted, long noops, float requestsPerSecond, Elastic.Clients.Elasticsearch.Retries retries, System.TimeSpan throttledMillis, System.TimeSpan throttledUntilMillis, long total, long versionConflicts) { Batches = batches; - Created = created; Deleted = deleted; Noops = noops; RequestsPerSecond = requestsPerSecond; @@ -38,7 +37,6 @@ public ReindexStatus(long batches, long created, long deleted, long noops, float ThrottledMillis = throttledMillis; ThrottledUntilMillis = throttledUntilMillis; Total = total; - Updated = updated; VersionConflicts = versionConflicts; } @@ -59,12 +57,19 @@ internal ReindexStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstruct /// public required long Batches { get; set; } + /// + /// + /// The reason for cancellation if the slice was canceled + /// + /// + public string? Cancelled { get; set; } + /// /// /// The number of documents that were successfully created. /// /// - public required long Created { get; set; } + public long? Created { get; set; } /// /// @@ -93,6 +98,13 @@ internal ReindexStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstruct /// /// public required Elastic.Clients.Elasticsearch.Retries Retries { get; set; } + + /// + /// + /// The slice ID + /// + /// + public int? SliceId { get; set; } public Elastic.Clients.Elasticsearch.Duration? Throttled { get; set; } /// @@ -123,7 +135,7 @@ internal ReindexStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstruct /// The number of documents that were successfully updated, for example, a document with same ID already existed prior to reindex updating it. /// /// - public required long Updated { get; set; } + public long? Updated { get; set; } /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/StorageOption.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/StorageOption.Converters.g.cs new file mode 100644 index 00000000000..5de3b3ef67f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/StorageOption.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchableSnapshots.Json; + +public sealed partial class StorageOptionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberFullCopy = System.Text.Json.JsonEncodedText.Encode("full_copy"u8); + private static readonly System.Text.Json.JsonEncodedText MemberSharedCache = System.Text.Json.JsonEncodedText.Encode("shared_cache"u8); + + public override Elastic.Clients.Elasticsearch.SearchableSnapshots.StorageOption Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberFullCopy)) + { + return Elastic.Clients.Elasticsearch.SearchableSnapshots.StorageOption.FullCopy; + } + + if (reader.ValueTextEquals(MemberSharedCache)) + { + return Elastic.Clients.Elasticsearch.SearchableSnapshots.StorageOption.SharedCache; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberFullCopy.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.SearchableSnapshots.StorageOption.FullCopy; + } + + if (string.Equals(value, MemberSharedCache.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.SearchableSnapshots.StorageOption.SharedCache; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.SearchableSnapshots.StorageOption)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchableSnapshots.StorageOption value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.SearchableSnapshots.StorageOption.FullCopy: + writer.WriteStringValue(MemberFullCopy); + break; + case Elastic.Clients.Elasticsearch.SearchableSnapshots.StorageOption.SharedCache: + writer.WriteStringValue(MemberSharedCache); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.SearchableSnapshots.StorageOption)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.SearchableSnapshots.StorageOption ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchableSnapshots.StorageOption value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/StorageOption.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/StorageOption.g.cs new file mode 100644 index 00000000000..89c684a89d4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/StorageOption.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchableSnapshots; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchableSnapshots.Json.StorageOptionConverter))] +public enum StorageOption +{ + /// + /// + /// Fully caches the snapshotted index’s shards in the Elasticsearch cluster. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "full_copy")] + FullCopy, + /// + /// + /// Uses a local cache containing only recently searched parts of the snapshotted index’s data. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "shared_cache")] + SharedCache +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ClusterPrivilege.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ClusterPrivilege.g.cs index 3bba278f411..2ff145243fa 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ClusterPrivilege.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ClusterPrivilege.g.cs @@ -58,6 +58,7 @@ namespace Elastic.Clients.Elasticsearch.Security; public static ClusterPrivilege ManageOidc { get; } = new ClusterPrivilege("manage_oidc"); public static ClusterPrivilege ManageOwnApiKey { get; } = new ClusterPrivilege("manage_own_api_key"); public static ClusterPrivilege ManagePipeline { get; } = new ClusterPrivilege("manage_pipeline"); + public static ClusterPrivilege ManageProjectRouting { get; } = new ClusterPrivilege("manage_project_routing"); public static ClusterPrivilege ManageRollup { get; } = new ClusterPrivilege("manage_rollup"); public static ClusterPrivilege ManageSaml { get; } = new ClusterPrivilege("manage_saml"); public static ClusterPrivilege ManageSearchApplication { get; } = new ClusterPrivilege("manage_search_application"); @@ -89,6 +90,7 @@ namespace Elastic.Clients.Elasticsearch.Security; public static ClusterPrivilege ReadFleetSecrets { get; } = new ClusterPrivilege("read_fleet_secrets"); public static ClusterPrivilege ReadIlm { get; } = new ClusterPrivilege("read_ilm"); public static ClusterPrivilege ReadPipeline { get; } = new ClusterPrivilege("read_pipeline"); + public static ClusterPrivilege ReadProjectRouting { get; } = new ClusterPrivilege("read_project_routing"); public static ClusterPrivilege ReadSecurity { get; } = new ClusterPrivilege("read_security"); public static ClusterPrivilege ReadSlm { get; } = new ClusterPrivilege("read_slm"); public static ClusterPrivilege TransportClient { get; } = new ClusterPrivilege("transport_client"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Streams/LogsStatus.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Streams/StreamStatus.Converters.g.cs similarity index 79% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Streams/LogsStatus.Converters.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Streams/StreamStatus.Converters.g.cs index f45335b4ade..23d04f87896 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Streams/LogsStatus.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Streams/StreamStatus.Converters.g.cs @@ -23,11 +23,11 @@ namespace Elastic.Clients.Elasticsearch.Streams.Json; -public sealed partial class LogsStatusConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class StreamStatusConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"u8); - public override Elastic.Clients.Elasticsearch.Streams.LogsStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + public override Elastic.Clients.Elasticsearch.Streams.StreamStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propEnabled = default; @@ -48,13 +48,13 @@ public override Elastic.Clients.Elasticsearch.Streams.LogsStatus Read(ref System } reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Streams.LogsStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + return new Elastic.Clients.Elasticsearch.Streams.StreamStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Enabled = propEnabled.Value }; } - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Streams.LogsStatus value, System.Text.Json.JsonSerializerOptions options) + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Streams.StreamStatus value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Streams/LogsStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Streams/StreamStatus.g.cs similarity index 84% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Streams/LogsStatus.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Streams/StreamStatus.g.cs index 5f203264ae3..b7e394d1246 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Streams/LogsStatus.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Streams/StreamStatus.g.cs @@ -23,28 +23,28 @@ namespace Elastic.Clients.Elasticsearch.Streams; -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Streams.Json.LogsStatusConverter))] -public sealed partial class LogsStatus +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Streams.Json.StreamStatusConverter))] +public sealed partial class StreamStatus { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public LogsStatus(bool enabled) + public StreamStatus(bool enabled) { Enabled = enabled; } - public LogsStatus() + public StreamStatus() { } [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - internal LogsStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + internal StreamStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) { _ = sentinel; } /// /// - /// If true, the logs stream feature is enabled. + /// If true, the stream feature is enabled. /// /// public required bool Enabled { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Streams/StreamType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Streams/StreamType.Converters.g.cs new file mode 100644 index 00000000000..33f513e915b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Streams/StreamType.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Streams.Json; + +public sealed partial class StreamTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberLogs = System.Text.Json.JsonEncodedText.Encode("logs"u8); + private static readonly System.Text.Json.JsonEncodedText MemberLogsEcs = System.Text.Json.JsonEncodedText.Encode("logs.ecs"u8); + private static readonly System.Text.Json.JsonEncodedText MemberLogsOtel = System.Text.Json.JsonEncodedText.Encode("logs.otel"u8); + + public override Elastic.Clients.Elasticsearch.Streams.StreamType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { +#pragma warning disable CS0618 + if (reader.ValueTextEquals(MemberLogs)) + { + return Elastic.Clients.Elasticsearch.Streams.StreamType.Logs; + } +#pragma warning restore CS0618 + if (reader.ValueTextEquals(MemberLogsEcs)) + { + return Elastic.Clients.Elasticsearch.Streams.StreamType.LogsEcs; + } + + if (reader.ValueTextEquals(MemberLogsOtel)) + { + return Elastic.Clients.Elasticsearch.Streams.StreamType.LogsOtel; + } + + var value = reader.GetString()!; +#pragma warning disable CS0618 + if (string.Equals(value, MemberLogs.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Streams.StreamType.Logs; + } +#pragma warning restore CS0618 + if (string.Equals(value, MemberLogsEcs.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Streams.StreamType.LogsEcs; + } + + if (string.Equals(value, MemberLogsOtel.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Streams.StreamType.LogsOtel; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Streams.StreamType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Streams.StreamType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { +#pragma warning disable CS0618 + case Elastic.Clients.Elasticsearch.Streams.StreamType.Logs: + writer.WriteStringValue(MemberLogs); + break; +#pragma warning restore CS0618 + case Elastic.Clients.Elasticsearch.Streams.StreamType.LogsEcs: + writer.WriteStringValue(MemberLogsEcs); + break; + case Elastic.Clients.Elasticsearch.Streams.StreamType.LogsOtel: + writer.WriteStringValue(MemberLogsOtel); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Streams.StreamType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Streams.StreamType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Streams.StreamType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Streams/StreamType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Streams/StreamType.g.cs new file mode 100644 index 00000000000..1a79780c9fe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Streams/StreamType.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Streams; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Streams.Json.StreamTypeConverter))] +public enum StreamType +{ + /// + /// + /// The logs stream type. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "logs")] + [System.Obsolete("Deprecated in '9.4.0'. Use the 'logs.otel' and 'logs.ecs' types instead")] + Logs, + /// + /// + /// The logs.ecs stream type, meant for ECS-formatted data. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "logs.ecs")] + LogsEcs, + /// + /// + /// The logs.otel stream type, meant for OTel-formatted data. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "logs.otel")] + LogsOtel +} \ 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 3dc05a3b1e3..ab408624d03 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.g.cs @@ -49,6 +49,12 @@ internal TextEmbedding(Elastic.Clients.Elasticsearch.Serialization.JsonConstruct /// /// public string? ModelId { get; set; } + + /// + /// + /// The text to be converted into a vector by the specified model + /// + /// public required string ModelText { get; set; } } @@ -83,6 +89,11 @@ public Elastic.Clients.Elasticsearch.TextEmbeddingDescriptor ModelId(string? val return this; } + /// + /// + /// The text to be converted into a vector by the specified model + /// + /// public Elastic.Clients.Elasticsearch.TextEmbeddingDescriptor ModelText(string value) { Instance.ModelText = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Source.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Source.Converters.g.cs index 1a45a4136af..b23982b4a7f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Source.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Source.Converters.g.cs @@ -26,6 +26,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; public sealed partial class SourceConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("index"u8); + private static readonly System.Text.Json.JsonEncodedText PropProjectRouting = System.Text.Json.JsonEncodedText.Encode("project_routing"u8); private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"u8); private static readonly System.Text.Json.JsonEncodedText PropRuntimeMappings = System.Text.Json.JsonEncodedText.Encode("runtime_mappings"u8); @@ -33,6 +34,7 @@ public override Elastic.Clients.Elasticsearch.TransformManagement.Source Read(re { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propIndices = default; + LocalJsonValue propProjectRouting = default; LocalJsonValue propQuery = default; LocalJsonValue?> propRuntimeMappings = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) @@ -42,6 +44,11 @@ public override Elastic.Clients.Elasticsearch.TransformManagement.Source Read(re continue; } + if (propProjectRouting.TryReadProperty(ref reader, options, PropProjectRouting, null)) + { + continue; + } + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) { continue; @@ -65,6 +72,7 @@ public override Elastic.Clients.Elasticsearch.TransformManagement.Source Read(re return new Elastic.Clients.Elasticsearch.TransformManagement.Source(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Indices = propIndices.Value, + ProjectRouting = propProjectRouting.Value, Query = propQuery.Value, RuntimeMappings = propRuntimeMappings.Value }; @@ -74,6 +82,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropIndices, value.Indices, null, null); + writer.WriteProperty(options, PropProjectRouting, value.ProjectRouting, null, null); writer.WriteProperty(options, PropQuery, value.Query, null, null); writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Source.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Source.g.cs index a0de51fd2e9..4dbe6e32144 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Source.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Source.g.cs @@ -52,6 +52,20 @@ internal Source(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSenti /// public required Elastic.Clients.Elasticsearch.Indices Indices { get; set; } + /// + /// + /// Specifies a subset of projects to target using project + /// metadata tags in a subset of Lucene query syntax. + /// Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + /// Examples: + /// _alias:my-project + /// _alias:_origin + /// _alias:pr + /// Supported in serverless only. + /// + /// + public string? ProjectRouting { get; set; } + /// /// /// A query clause that retrieves a subset of data from the source index. @@ -101,6 +115,24 @@ public Elastic.Clients.Elasticsearch.TransformManagement.SourceDescriptor + /// + /// Specifies a subset of projects to target using project + /// metadata tags in a subset of Lucene query syntax. + /// Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + /// Examples: + /// _alias:my-project + /// _alias:_origin + /// _alias:pr + /// Supported in serverless only. + /// + /// + public Elastic.Clients.Elasticsearch.TransformManagement.SourceDescriptor ProjectRouting(string? value) + { + Instance.ProjectRouting = value; + return this; + } + /// /// /// A query clause that retrieves a subset of data from the source index. @@ -229,6 +261,24 @@ public Elastic.Clients.Elasticsearch.TransformManagement.SourceDescriptor Indice return this; } + /// + /// + /// Specifies a subset of projects to target using project + /// metadata tags in a subset of Lucene query syntax. + /// Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + /// Examples: + /// _alias:my-project + /// _alias:_origin + /// _alias:pr + /// Supported in serverless only. + /// + /// + public Elastic.Clients.Elasticsearch.TransformManagement.SourceDescriptor ProjectRouting(string? value) + { + Instance.ProjectRouting = value; + return this; + } + /// /// /// A query clause that retrieves a subset of data from the source index. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Features.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Features.Converters.g.cs index 4c614a1e899..a18c26be909 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Features.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Features.Converters.g.cs @@ -35,6 +35,7 @@ public sealed partial class FeaturesConverter : System.Text.Json.Serialization.J private static readonly System.Text.Json.JsonEncodedText PropEnterpriseSearch = System.Text.Json.JsonEncodedText.Encode("enterprise_search"u8); private static readonly System.Text.Json.JsonEncodedText PropEql = System.Text.Json.JsonEncodedText.Encode("eql"u8); private static readonly System.Text.Json.JsonEncodedText PropEsql = System.Text.Json.JsonEncodedText.Encode("esql"u8); + private static readonly System.Text.Json.JsonEncodedText PropGpuVectorIndexing = System.Text.Json.JsonEncodedText.Encode("gpu_vector_indexing"u8); private static readonly System.Text.Json.JsonEncodedText PropGraph = System.Text.Json.JsonEncodedText.Encode("graph"u8); private static readonly System.Text.Json.JsonEncodedText PropIlm = System.Text.Json.JsonEncodedText.Encode("ilm"u8); private static readonly System.Text.Json.JsonEncodedText PropLogsdb = System.Text.Json.JsonEncodedText.Encode("logsdb"u8); @@ -66,6 +67,7 @@ public override Elastic.Clients.Elasticsearch.Xpack.Features Read(ref System.Tex LocalJsonValue propEnterpriseSearch = default; LocalJsonValue propEql = default; LocalJsonValue propEsql = default; + LocalJsonValue propGpuVectorIndexing = default; LocalJsonValue propGraph = default; LocalJsonValue propIlm = default; LocalJsonValue propLogsdb = default; @@ -135,6 +137,11 @@ public override Elastic.Clients.Elasticsearch.Xpack.Features Read(ref System.Tex continue; } + if (propGpuVectorIndexing.TryReadProperty(ref reader, options, PropGpuVectorIndexing, null)) + { + continue; + } + if (propGraph.TryReadProperty(ref reader, options, PropGraph, null)) { continue; @@ -242,6 +249,7 @@ public override Elastic.Clients.Elasticsearch.Xpack.Features Read(ref System.Tex EnterpriseSearch = propEnterpriseSearch.Value, Eql = propEql.Value, Esql = propEsql.Value, + GpuVectorIndexing = propGpuVectorIndexing.Value, Graph = propGraph.Value, Ilm = propIlm.Value, Logsdb = propLogsdb.Value, @@ -275,6 +283,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropEnterpriseSearch, value.EnterpriseSearch, null, null); writer.WriteProperty(options, PropEql, value.Eql, null, null); writer.WriteProperty(options, PropEsql, value.Esql, null, null); + writer.WriteProperty(options, PropGpuVectorIndexing, value.GpuVectorIndexing, null, null); writer.WriteProperty(options, PropGraph, value.Graph, null, null); writer.WriteProperty(options, PropIlm, value.Ilm, null, null); writer.WriteProperty(options, PropLogsdb, value.Logsdb, null, null); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Features.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Features.g.cs index 347881eac16..00cf88d4724 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Features.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Features.g.cs @@ -73,6 +73,7 @@ internal Features(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSen public Elastic.Clients.Elasticsearch.Xpack.Feature? EnterpriseSearch { get; set; } public required Elastic.Clients.Elasticsearch.Xpack.Feature Eql { get; set; } public Elastic.Clients.Elasticsearch.Xpack.Feature? Esql { get; set; } + public Elastic.Clients.Elasticsearch.Xpack.Feature? GpuVectorIndexing { get; set; } public required Elastic.Clients.Elasticsearch.Xpack.Feature Graph { get; set; } public required Elastic.Clients.Elasticsearch.Xpack.Feature Ilm { get; set; } public required Elastic.Clients.Elasticsearch.Xpack.Feature Logsdb { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/GpuNodeStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/GpuNodeStats.Converters.g.cs new file mode 100644 index 00000000000..dca80bf13ee --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/GpuNodeStats.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class GpuNodeStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"u8); + private static readonly System.Text.Json.JsonEncodedText PropIndexBuildCount = System.Text.Json.JsonEncodedText.Encode("index_build_count"u8); + private static readonly System.Text.Json.JsonEncodedText PropMemoryInBytes = System.Text.Json.JsonEncodedText.Encode("memory_in_bytes"u8); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"u8); + + public override Elastic.Clients.Elasticsearch.Xpack.GpuNodeStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEnabled = default; + LocalJsonValue propIndexBuildCount = default; + LocalJsonValue propMemoryInBytes = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propIndexBuildCount.TryReadProperty(ref reader, options, PropIndexBuildCount, null)) + { + continue; + } + + if (propMemoryInBytes.TryReadProperty(ref reader, options, PropMemoryInBytes, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.GpuNodeStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Enabled = propEnabled.Value, + IndexBuildCount = propIndexBuildCount.Value, + MemoryInBytes = propMemoryInBytes.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.GpuNodeStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropIndexBuildCount, value.IndexBuildCount, null, null); + writer.WriteProperty(options, PropMemoryInBytes, value.MemoryInBytes, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/GpuNodeStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/GpuNodeStats.g.cs new file mode 100644 index 00000000000..fa2ee303e29 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/GpuNodeStats.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +/// +/// +/// Per-node GPU statistics for vector indexing. +/// +/// +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.GpuNodeStatsConverter))] +public sealed partial class GpuNodeStats +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public GpuNodeStats(bool enabled, long indexBuildCount, long memoryInBytes, string type) + { + Enabled = enabled; + IndexBuildCount = indexBuildCount; + MemoryInBytes = memoryInBytes; + Type = type; + } + + public GpuNodeStats() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal GpuNodeStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// Whether GPU vector indexing is enabled on this node. + /// + /// + public required bool Enabled { get; set; } + + /// + /// + /// Number of GPU index builds performed on this node. + /// + /// + public required long IndexBuildCount { get; set; } + + /// + /// + /// GPU memory in bytes. + /// + /// + public required long MemoryInBytes { get; set; } + + /// + /// + /// GPU device type (e.g., "NVIDIA L4", "NVIDIA A100"). + /// + /// + public required string Type { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/GpuVectorIndexing.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/GpuVectorIndexing.Converters.g.cs new file mode 100644 index 00000000000..0ce545dfa0f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/GpuVectorIndexing.Converters.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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class GpuVectorIndexingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"u8); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"u8); + private static readonly System.Text.Json.JsonEncodedText PropIndexBuildCount = System.Text.Json.JsonEncodedText.Encode("index_build_count"u8); + private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"u8); + private static readonly System.Text.Json.JsonEncodedText PropNodesWithGpu = System.Text.Json.JsonEncodedText.Encode("nodes_with_gpu"u8); + + public override Elastic.Clients.Elasticsearch.Xpack.GpuVectorIndexing Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvailable = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propIndexBuildCount = default; + LocalJsonValue> propNodes = default; + LocalJsonValue propNodesWithGpu = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propIndexBuildCount.TryReadProperty(ref reader, options, PropIndexBuildCount, null)) + { + continue; + } + + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propNodesWithGpu.TryReadProperty(ref reader, options, PropNodesWithGpu, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.GpuVectorIndexing(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Available = propAvailable.Value, + Enabled = propEnabled.Value, + IndexBuildCount = propIndexBuildCount.Value, + Nodes = propNodes.Value, + NodesWithGpu = propNodesWithGpu.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.GpuVectorIndexing value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvailable, value.Available, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropIndexBuildCount, value.IndexBuildCount, null, null); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropNodesWithGpu, value.NodesWithGpu, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/GpuVectorIndexing.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/GpuVectorIndexing.g.cs new file mode 100644 index 00000000000..29c3203aed8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/GpuVectorIndexing.g.cs @@ -0,0 +1,77 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +/// +/// +/// GPU vector indexing usage statistics. +/// +/// +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.GpuVectorIndexingConverter))] +public sealed partial class GpuVectorIndexing +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public GpuVectorIndexing(bool available, bool enabled, long indexBuildCount, System.Collections.Generic.IReadOnlyCollection nodes, int nodesWithGpu) + { + Available = available; + Enabled = enabled; + IndexBuildCount = indexBuildCount; + Nodes = nodes; + NodesWithGpu = nodesWithGpu; + } + + public GpuVectorIndexing() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal GpuVectorIndexing(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public required bool Available { get; set; } + public required bool Enabled { get; set; } + + /// + /// + /// Total GPU index builds across the cluster. + /// + /// + public required long IndexBuildCount { get; set; } + + /// + /// + /// Per-node GPU details including type, memory, enabled status, and build count. + /// + /// + public required System.Collections.Generic.IReadOnlyCollection Nodes { get; set; } + + /// + /// + /// Count of data nodes with GPU support. + /// + /// + public required int NodesWithGpu { get; set; } +} \ No newline at end of file