diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlsLookup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlsLookup.g.cs index 23c77923d86..3111f005ed5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlsLookup.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlsLookup.g.cs @@ -38,6 +38,7 @@ internal static class ApiUrlsLookups internal static ApiUrls EqlGet = new ApiUrls(new[] { "/_eql/search/{id}" }); internal static ApiUrls NoNamespaceExists = new ApiUrls(new[] { "/{index}/_doc/{id}" }); internal static ApiUrls NoNamespaceGet = new ApiUrls(new[] { "/{index}/_doc/{id}" }); + internal static ApiUrls GraphExplore = new ApiUrls(new[] { "/{index}/_graph/explore" }); internal static ApiUrls IndexManagementDelete = new ApiUrls(new[] { "/{index}" }); internal static ApiUrls IndexManagementExists = new ApiUrls(new[] { "/{index}" }); internal static ApiUrls IndexManagementRefresh = new ApiUrls(new[] { "/_refresh", "/{index}/_refresh" }); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/GraphExploreRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/GraphExploreRequest.g.cs new file mode 100644 index 00000000000..618f8041f7c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/GraphExploreRequest.g.cs @@ -0,0 +1,430 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Graph +{ + public class GraphExploreRequestParameters : RequestParameters + { + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Time? Timeout { get => Q("timeout"); set => Q("timeout", value); } + } + + public partial class GraphExploreRequest : PlainRequestBase + { + public GraphExploreRequest(Elastic.Clients.Elasticsearch.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlsLookups.GraphExplore; + protected override HttpMethod HttpMethod => HttpMethod.POST; + protected override bool SupportsBody => true; + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Routing? Routing { get => Q("routing"); set => Q("routing", value); } + + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Time? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + [JsonInclude] + [JsonPropertyName("connections")] + public Elastic.Clients.Elasticsearch.Graph.Hop? Connections { get; set; } + + [JsonInclude] + [JsonPropertyName("controls")] + public Elastic.Clients.Elasticsearch.Graph.ExploreControls? Controls { get; set; } + + [JsonInclude] + [JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.QueryDsl.QueryContainer? Query { get; set; } + + [JsonInclude] + [JsonPropertyName("vertices")] + public IEnumerable? Vertices { get; set; } + } + + public sealed partial class GraphExploreRequestDescriptor : RequestDescriptorBase, GraphExploreRequestParameters> + { + internal GraphExploreRequestDescriptor(Action> configure) => configure.Invoke(this); + public GraphExploreRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal GraphExploreRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlsLookups.GraphExplore; + protected override HttpMethod HttpMethod => HttpMethod.POST; + protected override bool SupportsBody => true; + public GraphExploreRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Routing? routing) => Qs("routing", routing); + public GraphExploreRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Time? timeout) => Qs("timeout", timeout); + public GraphExploreRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + private Elastic.Clients.Elasticsearch.Graph.Hop? ConnectionsValue { get; set; } + + private HopDescriptor ConnectionsDescriptor { get; set; } + + private Action> ConnectionsDescriptorAction { get; set; } + + private Elastic.Clients.Elasticsearch.Graph.ExploreControls? ControlsValue { get; set; } + + private ExploreControlsDescriptor ControlsDescriptor { get; set; } + + private Action> ControlsDescriptorAction { get; set; } + + private Elastic.Clients.Elasticsearch.QueryDsl.QueryContainer? QueryValue { get; set; } + + private QueryDsl.QueryContainerDescriptor QueryDescriptor { get; set; } + + private Action> QueryDescriptorAction { get; set; } + + private IEnumerable? VerticesValue { get; set; } + + public GraphExploreRequestDescriptor Connections(Elastic.Clients.Elasticsearch.Graph.Hop? connections) + { + ConnectionsDescriptor = null; + ConnectionsDescriptorAction = null; + ConnectionsValue = connections; + return Self; + } + + public GraphExploreRequestDescriptor Connections(Graph.HopDescriptor descriptor) + { + ConnectionsValue = null; + ConnectionsDescriptorAction = null; + ConnectionsDescriptor = descriptor; + return Self; + } + + public GraphExploreRequestDescriptor Connections(Action> configure) + { + ConnectionsValue = null; + ConnectionsDescriptorAction = null; + ConnectionsDescriptorAction = configure; + return Self; + } + + public GraphExploreRequestDescriptor Controls(Elastic.Clients.Elasticsearch.Graph.ExploreControls? controls) + { + ControlsDescriptor = null; + ControlsDescriptorAction = null; + ControlsValue = controls; + return Self; + } + + public GraphExploreRequestDescriptor Controls(Graph.ExploreControlsDescriptor descriptor) + { + ControlsValue = null; + ControlsDescriptorAction = null; + ControlsDescriptor = descriptor; + return Self; + } + + public GraphExploreRequestDescriptor Controls(Action> configure) + { + ControlsValue = null; + ControlsDescriptorAction = null; + ControlsDescriptorAction = configure; + return Self; + } + + public GraphExploreRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryContainer? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public GraphExploreRequestDescriptor Query(QueryDsl.QueryContainerDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public GraphExploreRequestDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptorAction = configure; + return Self; + } + + public GraphExploreRequestDescriptor Vertices(IEnumerable? vertices) + { + VerticesValue = vertices; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ConnectionsDescriptor is not null) + { + writer.WritePropertyName("connections"); + JsonSerializer.Serialize(writer, ConnectionsDescriptor, options); + } + else if (ConnectionsDescriptorAction is not null) + { + writer.WritePropertyName("connections"); + JsonSerializer.Serialize(writer, new Graph.HopDescriptor(ConnectionsDescriptorAction), options); + } + else if (ConnectionsValue is not null) + { + writer.WritePropertyName("connections"); + JsonSerializer.Serialize(writer, ConnectionsValue, options); + } + + if (ControlsDescriptor is not null) + { + writer.WritePropertyName("controls"); + JsonSerializer.Serialize(writer, ControlsDescriptor, options); + } + else if (ControlsDescriptorAction is not null) + { + writer.WritePropertyName("controls"); + JsonSerializer.Serialize(writer, new Graph.ExploreControlsDescriptor(ControlsDescriptorAction), options); + } + else if (ControlsValue is not null) + { + writer.WritePropertyName("controls"); + JsonSerializer.Serialize(writer, ControlsValue, options); + } + + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryContainerDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (VerticesValue is not null) + { + writer.WritePropertyName("vertices"); + JsonSerializer.Serialize(writer, VerticesValue, options); + } + + writer.WriteEndObject(); + } + } + + public sealed partial class GraphExploreRequestDescriptor : RequestDescriptorBase + { + internal GraphExploreRequestDescriptor(Action configure) => configure.Invoke(this); + public GraphExploreRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal GraphExploreRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlsLookups.GraphExplore; + protected override HttpMethod HttpMethod => HttpMethod.POST; + protected override bool SupportsBody => true; + public GraphExploreRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Routing? routing) => Qs("routing", routing); + public GraphExploreRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Time? timeout) => Qs("timeout", timeout); + public GraphExploreRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + private Elastic.Clients.Elasticsearch.Graph.Hop? ConnectionsValue { get; set; } + + private HopDescriptor ConnectionsDescriptor { get; set; } + + private Action ConnectionsDescriptorAction { get; set; } + + private Elastic.Clients.Elasticsearch.Graph.ExploreControls? ControlsValue { get; set; } + + private ExploreControlsDescriptor ControlsDescriptor { get; set; } + + private Action ControlsDescriptorAction { get; set; } + + private Elastic.Clients.Elasticsearch.QueryDsl.QueryContainer? QueryValue { get; set; } + + private QueryDsl.QueryContainerDescriptor QueryDescriptor { get; set; } + + private Action QueryDescriptorAction { get; set; } + + private IEnumerable? VerticesValue { get; set; } + + public GraphExploreRequestDescriptor Connections(Elastic.Clients.Elasticsearch.Graph.Hop? connections) + { + ConnectionsDescriptor = null; + ConnectionsDescriptorAction = null; + ConnectionsValue = connections; + return Self; + } + + public GraphExploreRequestDescriptor Connections(Graph.HopDescriptor descriptor) + { + ConnectionsValue = null; + ConnectionsDescriptorAction = null; + ConnectionsDescriptor = descriptor; + return Self; + } + + public GraphExploreRequestDescriptor Connections(Action configure) + { + ConnectionsValue = null; + ConnectionsDescriptorAction = null; + ConnectionsDescriptorAction = configure; + return Self; + } + + public GraphExploreRequestDescriptor Controls(Elastic.Clients.Elasticsearch.Graph.ExploreControls? controls) + { + ControlsDescriptor = null; + ControlsDescriptorAction = null; + ControlsValue = controls; + return Self; + } + + public GraphExploreRequestDescriptor Controls(Graph.ExploreControlsDescriptor descriptor) + { + ControlsValue = null; + ControlsDescriptorAction = null; + ControlsDescriptor = descriptor; + return Self; + } + + public GraphExploreRequestDescriptor Controls(Action configure) + { + ControlsValue = null; + ControlsDescriptorAction = null; + ControlsDescriptorAction = configure; + return Self; + } + + public GraphExploreRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryContainer? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public GraphExploreRequestDescriptor Query(QueryDsl.QueryContainerDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public GraphExploreRequestDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptorAction = configure; + return Self; + } + + public GraphExploreRequestDescriptor Vertices(IEnumerable? vertices) + { + VerticesValue = vertices; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ConnectionsDescriptor is not null) + { + writer.WritePropertyName("connections"); + JsonSerializer.Serialize(writer, ConnectionsDescriptor, options); + } + else if (ConnectionsDescriptorAction is not null) + { + writer.WritePropertyName("connections"); + JsonSerializer.Serialize(writer, new Graph.HopDescriptor(ConnectionsDescriptorAction), options); + } + else if (ConnectionsValue is not null) + { + writer.WritePropertyName("connections"); + JsonSerializer.Serialize(writer, ConnectionsValue, options); + } + + if (ControlsDescriptor is not null) + { + writer.WritePropertyName("controls"); + JsonSerializer.Serialize(writer, ControlsDescriptor, options); + } + else if (ControlsDescriptorAction is not null) + { + writer.WritePropertyName("controls"); + JsonSerializer.Serialize(writer, new Graph.ExploreControlsDescriptor(ControlsDescriptorAction), options); + } + else if (ControlsValue is not null) + { + writer.WritePropertyName("controls"); + JsonSerializer.Serialize(writer, ControlsValue, options); + } + + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryContainerDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (VerticesValue is not null) + { + writer.WritePropertyName("vertices"); + JsonSerializer.Serialize(writer, VerticesValue, options); + } + + writer.WriteEndObject(); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/GraphExploreResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/GraphExploreResponse.g.cs new file mode 100644 index 00000000000..de30e1cef61 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/GraphExploreResponse.g.cs @@ -0,0 +1,47 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Graph +{ + public partial class GraphExploreResponse : ElasticsearchResponseBase + { + [JsonInclude] + [JsonPropertyName("connections")] + public IReadOnlyCollection Connections { get; init; } + + [JsonInclude] + [JsonPropertyName("failures")] + public IReadOnlyCollection Failures { get; init; } + + [JsonInclude] + [JsonPropertyName("timed_out")] + public bool TimedOut { get; init; } + + [JsonInclude] + [JsonPropertyName("took")] + public long Took { get; init; } + + [JsonInclude] + [JsonPropertyName("vertices")] + public IReadOnlyCollection Vertices { get; init; } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Graph.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Graph.g.cs new file mode 100644 index 00000000000..c1d5640e2ca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Graph.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +using System; +using System.Threading; +using System.Threading.Tasks; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Graph +{ + public class GraphNamespace : NamespacedClientProxy + { + internal GraphNamespace(ElasticsearchClient client) : base(client) + { + } + + public GraphExploreResponse Explore(GraphExploreRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + public Task ExploreAsync(GraphExploreRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public GraphExploreResponse Explore(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest = null) + { + var descriptor = new GraphExploreRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + public Task ExploreAsync(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest = null, CancellationToken cancellationToken = default) + { + var descriptor = new GraphExploreRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs index ce02de60ffc..50ef9ab56ce 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs @@ -18,6 +18,7 @@ using Elastic.Clients.Elasticsearch.AsyncSearch; using Elastic.Clients.Elasticsearch.Cluster; using Elastic.Clients.Elasticsearch.Eql; +using Elastic.Clients.Elasticsearch.Graph; using Elastic.Clients.Elasticsearch.IndexManagement; using Elastic.Clients.Elasticsearch.Sql; using Elastic.Clients.Elasticsearch.Tasks; @@ -36,6 +37,8 @@ public partial class ElasticsearchClient public EqlNamespace Eql { get; private set; } + public GraphNamespace Graph { get; private set; } + public IndexManagementNamespace IndexManagement { get; private set; } public SqlNamespace Sql { get; private set; } @@ -47,6 +50,7 @@ private partial void SetupNamespaces() AsyncSearch = new AsyncSearchNamespace(this); Cluster = new ClusterNamespace(this); Eql = new EqlNamespace(this); + Graph = new GraphNamespace(this); IndexManagement = new IndexManagementNamespace(this); Sql = new SqlNamespace(this); Tasks = new TasksNamespace(this); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Connection.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Connection.g.cs new file mode 100644 index 00000000000..93e02442ee0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Connection.g.cs @@ -0,0 +1,45 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Graph +{ + public partial class Connection + { + [JsonInclude] + [JsonPropertyName("doc_count")] + public long DocCount { get; init; } + + [JsonInclude] + [JsonPropertyName("source")] + public long Source { get; init; } + + [JsonInclude] + [JsonPropertyName("target")] + public long Target { get; init; } + + [JsonInclude] + [JsonPropertyName("weight")] + public double Weight { get; init; } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/ExploreControls.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/ExploreControls.g.cs new file mode 100644 index 00000000000..3738a33d33b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/ExploreControls.g.cs @@ -0,0 +1,241 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Graph +{ + public partial class ExploreControls + { + [JsonInclude] + [JsonPropertyName("sample_diversity")] + public Elastic.Clients.Elasticsearch.Graph.SampleDiversity? SampleDiversity { get; set; } + + [JsonInclude] + [JsonPropertyName("sample_size")] + public int? SampleSize { get; set; } + + [JsonInclude] + [JsonPropertyName("timeout")] + public Elastic.Clients.Elasticsearch.Time? Timeout { get; set; } + + [JsonInclude] + [JsonPropertyName("use_significance")] + public bool UseSignificance { get; set; } + } + + public sealed partial class ExploreControlsDescriptor : DescriptorBase> + { + internal ExploreControlsDescriptor(Action> configure) => configure.Invoke(this); + public ExploreControlsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Graph.SampleDiversity? SampleDiversityValue { get; set; } + + private SampleDiversityDescriptor SampleDiversityDescriptor { get; set; } + + private Action> SampleDiversityDescriptorAction { get; set; } + + private int? SampleSizeValue { get; set; } + + private Elastic.Clients.Elasticsearch.Time? TimeoutValue { get; set; } + + private bool UseSignificanceValue { get; set; } + + public ExploreControlsDescriptor SampleDiversity(Elastic.Clients.Elasticsearch.Graph.SampleDiversity? sampleDiversity) + { + SampleDiversityDescriptor = null; + SampleDiversityDescriptorAction = null; + SampleDiversityValue = sampleDiversity; + return Self; + } + + public ExploreControlsDescriptor SampleDiversity(Graph.SampleDiversityDescriptor descriptor) + { + SampleDiversityValue = null; + SampleDiversityDescriptorAction = null; + SampleDiversityDescriptor = descriptor; + return Self; + } + + public ExploreControlsDescriptor SampleDiversity(Action> configure) + { + SampleDiversityValue = null; + SampleDiversityDescriptorAction = null; + SampleDiversityDescriptorAction = configure; + return Self; + } + + public ExploreControlsDescriptor SampleSize(int? sampleSize) + { + SampleSizeValue = sampleSize; + return Self; + } + + public ExploreControlsDescriptor Timeout(Elastic.Clients.Elasticsearch.Time? timeout) + { + TimeoutValue = timeout; + return Self; + } + + public ExploreControlsDescriptor UseSignificance(bool useSignificance = true) + { + UseSignificanceValue = useSignificance; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (SampleDiversityDescriptor is not null) + { + writer.WritePropertyName("sample_diversity"); + JsonSerializer.Serialize(writer, SampleDiversityDescriptor, options); + } + else if (SampleDiversityDescriptorAction is not null) + { + writer.WritePropertyName("sample_diversity"); + JsonSerializer.Serialize(writer, new Graph.SampleDiversityDescriptor(SampleDiversityDescriptorAction), options); + } + else if (SampleDiversityValue is not null) + { + writer.WritePropertyName("sample_diversity"); + JsonSerializer.Serialize(writer, SampleDiversityValue, options); + } + + if (SampleSizeValue.HasValue) + { + writer.WritePropertyName("sample_size"); + writer.WriteNumberValue(SampleSizeValue.Value); + } + + if (TimeoutValue is not null) + { + writer.WritePropertyName("timeout"); + JsonSerializer.Serialize(writer, TimeoutValue, options); + } + + writer.WritePropertyName("use_significance"); + writer.WriteBooleanValue(UseSignificanceValue); + writer.WriteEndObject(); + } + } + + public sealed partial class ExploreControlsDescriptor : DescriptorBase + { + internal ExploreControlsDescriptor(Action configure) => configure.Invoke(this); + public ExploreControlsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Graph.SampleDiversity? SampleDiversityValue { get; set; } + + private SampleDiversityDescriptor SampleDiversityDescriptor { get; set; } + + private Action SampleDiversityDescriptorAction { get; set; } + + private int? SampleSizeValue { get; set; } + + private Elastic.Clients.Elasticsearch.Time? TimeoutValue { get; set; } + + private bool UseSignificanceValue { get; set; } + + public ExploreControlsDescriptor SampleDiversity(Elastic.Clients.Elasticsearch.Graph.SampleDiversity? sampleDiversity) + { + SampleDiversityDescriptor = null; + SampleDiversityDescriptorAction = null; + SampleDiversityValue = sampleDiversity; + return Self; + } + + public ExploreControlsDescriptor SampleDiversity(Graph.SampleDiversityDescriptor descriptor) + { + SampleDiversityValue = null; + SampleDiversityDescriptorAction = null; + SampleDiversityDescriptor = descriptor; + return Self; + } + + public ExploreControlsDescriptor SampleDiversity(Action configure) + { + SampleDiversityValue = null; + SampleDiversityDescriptorAction = null; + SampleDiversityDescriptorAction = configure; + return Self; + } + + public ExploreControlsDescriptor SampleSize(int? sampleSize) + { + SampleSizeValue = sampleSize; + return Self; + } + + public ExploreControlsDescriptor Timeout(Elastic.Clients.Elasticsearch.Time? timeout) + { + TimeoutValue = timeout; + return Self; + } + + public ExploreControlsDescriptor UseSignificance(bool useSignificance = true) + { + UseSignificanceValue = useSignificance; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (SampleDiversityDescriptor is not null) + { + writer.WritePropertyName("sample_diversity"); + JsonSerializer.Serialize(writer, SampleDiversityDescriptor, options); + } + else if (SampleDiversityDescriptorAction is not null) + { + writer.WritePropertyName("sample_diversity"); + JsonSerializer.Serialize(writer, new Graph.SampleDiversityDescriptor(SampleDiversityDescriptorAction), options); + } + else if (SampleDiversityValue is not null) + { + writer.WritePropertyName("sample_diversity"); + JsonSerializer.Serialize(writer, SampleDiversityValue, options); + } + + if (SampleSizeValue.HasValue) + { + writer.WritePropertyName("sample_size"); + writer.WriteNumberValue(SampleSizeValue.Value); + } + + if (TimeoutValue is not null) + { + writer.WritePropertyName("timeout"); + JsonSerializer.Serialize(writer, TimeoutValue, options); + } + + writer.WritePropertyName("use_significance"); + writer.WriteBooleanValue(UseSignificanceValue); + writer.WriteEndObject(); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Hop.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Hop.g.cs new file mode 100644 index 00000000000..f08ae0069f7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Hop.g.cs @@ -0,0 +1,273 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Graph +{ + public partial class Hop + { + [JsonInclude] + [JsonPropertyName("connections")] + public Elastic.Clients.Elasticsearch.Graph.Hop? Connections { get; set; } + + [JsonInclude] + [JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.QueryDsl.QueryContainer Query { get; set; } + + [JsonInclude] + [JsonPropertyName("vertices")] + public IEnumerable Vertices { get; set; } + } + + public sealed partial class HopDescriptor : DescriptorBase> + { + internal HopDescriptor(Action> configure) => configure.Invoke(this); + public HopDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Graph.Hop? ConnectionsValue { get; set; } + + private HopDescriptor ConnectionsDescriptor { get; set; } + + private Action> ConnectionsDescriptorAction { get; set; } + + private Elastic.Clients.Elasticsearch.QueryDsl.QueryContainer QueryValue { get; set; } + + private QueryDsl.QueryContainerDescriptor QueryDescriptor { get; set; } + + private Action> QueryDescriptorAction { get; set; } + + private IEnumerable VerticesValue { get; set; } + + public HopDescriptor Connections(Elastic.Clients.Elasticsearch.Graph.Hop? connections) + { + ConnectionsDescriptor = null; + ConnectionsDescriptorAction = null; + ConnectionsValue = connections; + return Self; + } + + public HopDescriptor Connections(Graph.HopDescriptor descriptor) + { + ConnectionsValue = null; + ConnectionsDescriptorAction = null; + ConnectionsDescriptor = descriptor; + return Self; + } + + public HopDescriptor Connections(Action> configure) + { + ConnectionsValue = null; + ConnectionsDescriptorAction = null; + ConnectionsDescriptorAction = configure; + return Self; + } + + public HopDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryContainer query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public HopDescriptor Query(QueryDsl.QueryContainerDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public HopDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptorAction = configure; + return Self; + } + + public HopDescriptor Vertices(IEnumerable vertices) + { + VerticesValue = vertices; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ConnectionsDescriptor is not null) + { + writer.WritePropertyName("connections"); + JsonSerializer.Serialize(writer, ConnectionsDescriptor, options); + } + else if (ConnectionsDescriptorAction is not null) + { + writer.WritePropertyName("connections"); + JsonSerializer.Serialize(writer, new Graph.HopDescriptor(ConnectionsDescriptorAction), options); + } + else if (ConnectionsValue is not null) + { + writer.WritePropertyName("connections"); + JsonSerializer.Serialize(writer, ConnectionsValue, options); + } + + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryContainerDescriptor(QueryDescriptorAction), options); + } + else + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + writer.WritePropertyName("vertices"); + JsonSerializer.Serialize(writer, VerticesValue, options); + writer.WriteEndObject(); + } + } + + public sealed partial class HopDescriptor : DescriptorBase + { + internal HopDescriptor(Action configure) => configure.Invoke(this); + public HopDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Graph.Hop? ConnectionsValue { get; set; } + + private HopDescriptor ConnectionsDescriptor { get; set; } + + private Action ConnectionsDescriptorAction { get; set; } + + private Elastic.Clients.Elasticsearch.QueryDsl.QueryContainer QueryValue { get; set; } + + private QueryDsl.QueryContainerDescriptor QueryDescriptor { get; set; } + + private Action QueryDescriptorAction { get; set; } + + private IEnumerable VerticesValue { get; set; } + + public HopDescriptor Connections(Elastic.Clients.Elasticsearch.Graph.Hop? connections) + { + ConnectionsDescriptor = null; + ConnectionsDescriptorAction = null; + ConnectionsValue = connections; + return Self; + } + + public HopDescriptor Connections(Graph.HopDescriptor descriptor) + { + ConnectionsValue = null; + ConnectionsDescriptorAction = null; + ConnectionsDescriptor = descriptor; + return Self; + } + + public HopDescriptor Connections(Action configure) + { + ConnectionsValue = null; + ConnectionsDescriptorAction = null; + ConnectionsDescriptorAction = configure; + return Self; + } + + public HopDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryContainer query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public HopDescriptor Query(QueryDsl.QueryContainerDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public HopDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptorAction = configure; + return Self; + } + + public HopDescriptor Vertices(IEnumerable vertices) + { + VerticesValue = vertices; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ConnectionsDescriptor is not null) + { + writer.WritePropertyName("connections"); + JsonSerializer.Serialize(writer, ConnectionsDescriptor, options); + } + else if (ConnectionsDescriptorAction is not null) + { + writer.WritePropertyName("connections"); + JsonSerializer.Serialize(writer, new Graph.HopDescriptor(ConnectionsDescriptorAction), options); + } + else if (ConnectionsValue is not null) + { + writer.WritePropertyName("connections"); + JsonSerializer.Serialize(writer, ConnectionsValue, options); + } + + if (QueryDescriptor is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new QueryDsl.QueryContainerDescriptor(QueryDescriptorAction), options); + } + else + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + writer.WritePropertyName("vertices"); + JsonSerializer.Serialize(writer, VerticesValue, options); + writer.WriteEndObject(); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/SampleDiversity.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/SampleDiversity.g.cs new file mode 100644 index 00000000000..8e8528addfa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/SampleDiversity.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. +// +// ------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Graph +{ + public partial class SampleDiversity + { + [JsonInclude] + [JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + [JsonInclude] + [JsonPropertyName("max_docs_per_value")] + public int MaxDocsPerValue { get; set; } + } + + public sealed partial class SampleDiversityDescriptor : DescriptorBase> + { + internal SampleDiversityDescriptor(Action> configure) => configure.Invoke(this); + public SampleDiversityDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + + private int MaxDocsPerValueValue { get; set; } + + public SampleDiversityDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + public SampleDiversityDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public SampleDiversityDescriptor MaxDocsPerValue(int maxDocsPerValue) + { + MaxDocsPerValueValue = maxDocsPerValue; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("max_docs_per_value"); + writer.WriteNumberValue(MaxDocsPerValueValue); + writer.WriteEndObject(); + } + } + + public sealed partial class SampleDiversityDescriptor : DescriptorBase + { + internal SampleDiversityDescriptor(Action configure) => configure.Invoke(this); + public SampleDiversityDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + + private int MaxDocsPerValueValue { get; set; } + + public SampleDiversityDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + public SampleDiversityDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public SampleDiversityDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public SampleDiversityDescriptor MaxDocsPerValue(int maxDocsPerValue) + { + MaxDocsPerValueValue = maxDocsPerValue; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("max_docs_per_value"); + writer.WriteNumberValue(MaxDocsPerValueValue); + writer.WriteEndObject(); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Vertex.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Vertex.g.cs new file mode 100644 index 00000000000..4631a8d1520 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Vertex.g.cs @@ -0,0 +1,45 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Graph +{ + public partial class Vertex + { + [JsonInclude] + [JsonPropertyName("depth")] + public long Depth { get; init; } + + [JsonInclude] + [JsonPropertyName("field")] + public string Field { get; init; } + + [JsonInclude] + [JsonPropertyName("term")] + public string Term { get; init; } + + [JsonInclude] + [JsonPropertyName("weight")] + public double Weight { get; init; } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/VertexDefinition.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/VertexDefinition.g.cs new file mode 100644 index 00000000000..433f3593dd3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/VertexDefinition.g.cs @@ -0,0 +1,259 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Graph +{ + public partial class VertexDefinition + { + [JsonInclude] + [JsonPropertyName("exclude")] + public IEnumerable? Exclude { get; set; } + + [JsonInclude] + [JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + [JsonInclude] + [JsonPropertyName("include")] + public IEnumerable? Include { get; set; } + + [JsonInclude] + [JsonPropertyName("min_doc_count")] + public long? MinDocCount { get; set; } + + [JsonInclude] + [JsonPropertyName("shard_min_doc_count")] + public long? ShardMinDocCount { get; set; } + + [JsonInclude] + [JsonPropertyName("size")] + public int? Size { get; set; } + } + + public sealed partial class VertexDefinitionDescriptor : DescriptorBase> + { + internal VertexDefinitionDescriptor(Action> configure) => configure.Invoke(this); + public VertexDefinitionDescriptor() : base() + { + } + + private IEnumerable? ExcludeValue { get; set; } + + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + + private IEnumerable? IncludeValue { get; set; } + + private long? MinDocCountValue { get; set; } + + private long? ShardMinDocCountValue { get; set; } + + private int? SizeValue { get; set; } + + public VertexDefinitionDescriptor Exclude(IEnumerable? exclude) + { + ExcludeValue = exclude; + return Self; + } + + public VertexDefinitionDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + public VertexDefinitionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public VertexDefinitionDescriptor Include(IEnumerable? include) + { + IncludeValue = include; + return Self; + } + + public VertexDefinitionDescriptor MinDocCount(long? minDocCount) + { + MinDocCountValue = minDocCount; + return Self; + } + + public VertexDefinitionDescriptor ShardMinDocCount(long? shardMinDocCount) + { + ShardMinDocCountValue = shardMinDocCount; + return Self; + } + + public VertexDefinitionDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ExcludeValue is not null) + { + writer.WritePropertyName("exclude"); + JsonSerializer.Serialize(writer, ExcludeValue, options); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (IncludeValue is not null) + { + writer.WritePropertyName("include"); + JsonSerializer.Serialize(writer, IncludeValue, options); + } + + if (MinDocCountValue.HasValue) + { + writer.WritePropertyName("min_doc_count"); + writer.WriteNumberValue(MinDocCountValue.Value); + } + + if (ShardMinDocCountValue.HasValue) + { + writer.WritePropertyName("shard_min_doc_count"); + writer.WriteNumberValue(ShardMinDocCountValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + writer.WriteEndObject(); + } + } + + public sealed partial class VertexDefinitionDescriptor : DescriptorBase + { + internal VertexDefinitionDescriptor(Action configure) => configure.Invoke(this); + public VertexDefinitionDescriptor() : base() + { + } + + private IEnumerable? ExcludeValue { get; set; } + + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + + private IEnumerable? IncludeValue { get; set; } + + private long? MinDocCountValue { get; set; } + + private long? ShardMinDocCountValue { get; set; } + + private int? SizeValue { get; set; } + + public VertexDefinitionDescriptor Exclude(IEnumerable? exclude) + { + ExcludeValue = exclude; + return Self; + } + + public VertexDefinitionDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + public VertexDefinitionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public VertexDefinitionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public VertexDefinitionDescriptor Include(IEnumerable? include) + { + IncludeValue = include; + return Self; + } + + public VertexDefinitionDescriptor MinDocCount(long? minDocCount) + { + MinDocCountValue = minDocCount; + return Self; + } + + public VertexDefinitionDescriptor ShardMinDocCount(long? shardMinDocCount) + { + ShardMinDocCountValue = shardMinDocCount; + return Self; + } + + public VertexDefinitionDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ExcludeValue is not null) + { + writer.WritePropertyName("exclude"); + JsonSerializer.Serialize(writer, ExcludeValue, options); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (IncludeValue is not null) + { + writer.WritePropertyName("include"); + JsonSerializer.Serialize(writer, IncludeValue, options); + } + + if (MinDocCountValue.HasValue) + { + writer.WritePropertyName("min_doc_count"); + writer.WriteNumberValue(MinDocCountValue.Value); + } + + if (ShardMinDocCountValue.HasValue) + { + writer.WritePropertyName("shard_min_doc_count"); + writer.WriteNumberValue(ShardMinDocCountValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + writer.WriteEndObject(); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/VertexInclude.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/VertexInclude.g.cs new file mode 100644 index 00000000000..9292b4511e7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/VertexInclude.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. +// +// ------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Graph +{ + public partial class VertexInclude + { + [JsonInclude] + [JsonPropertyName("boost")] + public double Boost { get; set; } + + [JsonInclude] + [JsonPropertyName("term")] + public string Term { get; set; } + } + + public sealed partial class VertexIncludeDescriptor : DescriptorBase + { + internal VertexIncludeDescriptor(Action configure) => configure.Invoke(this); + public VertexIncludeDescriptor() : base() + { + } + + private double BoostValue { get; set; } + + private string TermValue { get; set; } + + public VertexIncludeDescriptor Boost(double boost) + { + BoostValue = boost; + return Self; + } + + public VertexIncludeDescriptor Term(string term) + { + TermValue = term; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue); + writer.WritePropertyName("term"); + writer.WriteStringValue(TermValue); + writer.WriteEndObject(); + } + } +} \ No newline at end of file