Skip to content

[Backport 8.15] Regenerate client using the latest specification #8314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public sealed partial class GetResponse<TDocument> : ElasticsearchResponse
public bool Found { get; init; }
[JsonInclude, JsonPropertyName("_id")]
public string Id { get; init; }
[JsonInclude, JsonPropertyName("_ignored")]
public IReadOnlyCollection<string>? Ignored { get; init; }
[JsonInclude, JsonPropertyName("_index")]
public string Index { get; init; }
[JsonInclude, JsonPropertyName("_primary_term")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,4 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Nodes;

public sealed partial class HotThreadsResponse : ElasticsearchResponse
{
[JsonInclude, JsonPropertyName("hot_threads")]
public IReadOnlyCollection<Elastic.Clients.Elasticsearch.Serverless.Nodes.HotThread> HotThreads { get; init; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public PutSynonymRequest(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(
/// </para>
/// </summary>
[JsonInclude, JsonPropertyName("synonyms_set")]
[SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.Synonyms.SynonymRule))]
public ICollection<Elastic.Clients.Elasticsearch.Serverless.Synonyms.SynonymRule> SynonymsSet { get; set; }
}

Expand Down Expand Up @@ -140,32 +141,30 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
if (SynonymsSetDescriptor is not null)
{
writer.WritePropertyName("synonyms_set");
writer.WriteStartArray();
JsonSerializer.Serialize(writer, SynonymsSetDescriptor, options);
writer.WriteEndArray();
}
else if (SynonymsSetDescriptorAction is not null)
{
writer.WritePropertyName("synonyms_set");
writer.WriteStartArray();
JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Synonyms.SynonymRuleDescriptor(SynonymsSetDescriptorAction), options);
writer.WriteEndArray();
}
else if (SynonymsSetDescriptorActions is not null)
{
writer.WritePropertyName("synonyms_set");
writer.WriteStartArray();
if (SynonymsSetDescriptorActions.Length != 1)
writer.WriteStartArray();
foreach (var action in SynonymsSetDescriptorActions)
{
JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Synonyms.SynonymRuleDescriptor(action), options);
}

writer.WriteEndArray();
if (SynonymsSetDescriptorActions.Length != 1)
writer.WriteEndArray();
}
else
{
writer.WritePropertyName("synonyms_set");
JsonSerializer.Serialize(writer, SynonymsSetValue, options);
SingleOrManySerializationHelper.Serialize<Elastic.Clients.Elasticsearch.Serverless.Synonyms.SynonymRule>(SynonymsSetValue, writer, options);
}

writer.WriteEndObject();
Expand Down Expand Up @@ -251,32 +250,30 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
if (SynonymsSetDescriptor is not null)
{
writer.WritePropertyName("synonyms_set");
writer.WriteStartArray();
JsonSerializer.Serialize(writer, SynonymsSetDescriptor, options);
writer.WriteEndArray();
}
else if (SynonymsSetDescriptorAction is not null)
{
writer.WritePropertyName("synonyms_set");
writer.WriteStartArray();
JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Synonyms.SynonymRuleDescriptor(SynonymsSetDescriptorAction), options);
writer.WriteEndArray();
}
else if (SynonymsSetDescriptorActions is not null)
{
writer.WritePropertyName("synonyms_set");
writer.WriteStartArray();
if (SynonymsSetDescriptorActions.Length != 1)
writer.WriteStartArray();
foreach (var action in SynonymsSetDescriptorActions)
{
JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Synonyms.SynonymRuleDescriptor(action), options);
}

writer.WriteEndArray();
if (SynonymsSetDescriptorActions.Length != 1)
writer.WriteEndArray();
}
else
{
writer.WritePropertyName("synonyms_set");
JsonSerializer.Serialize(writer, SynonymsSetValue, options);
SingleOrManySerializationHelper.Serialize<Elastic.Clients.Elasticsearch.Serverless.Synonyms.SynonymRule>(SynonymsSetValue, writer, options);
}

writer.WriteEndObject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ public sealed partial class UpdateByQueryRequestParameters : RequestParameters
/// </summary>
public string? Preference { get => Q<string?>("preference"); set => Q("preference", value); }

/// <summary>
/// <para>
/// Query in the Lucene query string syntax.
/// </para>
/// </summary>
public string? QueryLuceneSyntax { get => Q<string?>("q"); set => Q("q", value); }

/// <summary>
/// <para>
/// If <c>true</c>, Elasticsearch refreshes affected shards to make the operation visible to search.
Expand Down Expand Up @@ -360,6 +367,14 @@ public UpdateByQueryRequest(Elastic.Clients.Elasticsearch.Serverless.Indices ind
[JsonIgnore]
public string? Preference { get => Q<string?>("preference"); set => Q("preference", value); }

/// <summary>
/// <para>
/// Query in the Lucene query string syntax.
/// </para>
/// </summary>
[JsonIgnore]
public string? QueryLuceneSyntax { get => Q<string?>("q"); set => Q("q", value); }

/// <summary>
/// <para>
/// If <c>true</c>, Elasticsearch refreshes affected shards to make the operation visible to search.
Expand Down Expand Up @@ -582,6 +597,7 @@ public UpdateByQueryRequestDescriptor() : this(typeof(TDocument))
public UpdateByQueryRequestDescriptor<TDocument> Lenient(bool? lenient = true) => Qs("lenient", lenient);
public UpdateByQueryRequestDescriptor<TDocument> Pipeline(string? pipeline) => Qs("pipeline", pipeline);
public UpdateByQueryRequestDescriptor<TDocument> Preference(string? preference) => Qs("preference", preference);
public UpdateByQueryRequestDescriptor<TDocument> QueryLuceneSyntax(string? queryLuceneSyntax) => Qs("q", queryLuceneSyntax);
public UpdateByQueryRequestDescriptor<TDocument> Refresh(bool? refresh = true) => Qs("refresh", refresh);
public UpdateByQueryRequestDescriptor<TDocument> RequestCache(bool? requestCache = true) => Qs("request_cache", requestCache);
public UpdateByQueryRequestDescriptor<TDocument> RequestsPerSecond(float? requestsPerSecond) => Qs("requests_per_second", requestsPerSecond);
Expand Down Expand Up @@ -828,6 +844,7 @@ public UpdateByQueryRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.I
public UpdateByQueryRequestDescriptor Lenient(bool? lenient = true) => Qs("lenient", lenient);
public UpdateByQueryRequestDescriptor Pipeline(string? pipeline) => Qs("pipeline", pipeline);
public UpdateByQueryRequestDescriptor Preference(string? preference) => Qs("preference", preference);
public UpdateByQueryRequestDescriptor QueryLuceneSyntax(string? queryLuceneSyntax) => Qs("q", queryLuceneSyntax);
public UpdateByQueryRequestDescriptor Refresh(bool? refresh = true) => Qs("refresh", refresh);
public UpdateByQueryRequestDescriptor RequestCache(bool? requestCache = true) => Qs("request_cache", requestCache);
public UpdateByQueryRequestDescriptor RequestsPerSecond(float? requestsPerSecond) => Qs("requests_per_second", requestsPerSecond);
Expand Down
Loading
Loading