Skip to content

Commit

Permalink
Regenerate client using the latest spec (#8129) (#8130)
Browse files Browse the repository at this point in the history
Co-authored-by: Florian Bernd <git@flobernd.de>
  • Loading branch information
github-actions[bot] and flobernd committed Apr 16, 2024
1 parent a52bb97 commit c517b9d
Show file tree
Hide file tree
Showing 173 changed files with 3,762 additions and 8,445 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public override SubmitAsyncSearchRequest Read(ref Utf8JsonReader reader, Type ty

if (property == "knn")
{
variant.Knn = JsonSerializer.Deserialize<ICollection<Elastic.Clients.Elasticsearch.Serverless.KnnQuery>?>(ref reader, options);
variant.Knn = JsonSerializer.Deserialize<ICollection<Elastic.Clients.Elasticsearch.Serverless.KnnSearch>?>(ref reader, options);
continue;
}

Expand Down Expand Up @@ -836,8 +836,8 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// <para>Defines the approximate kNN search to run.</para>
/// </summary>
[JsonInclude, JsonPropertyName("knn")]
[SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.KnnQuery))]
public ICollection<Elastic.Clients.Elasticsearch.Serverless.KnnQuery>? Knn { get; set; }
[SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.KnnSearch))]
public ICollection<Elastic.Clients.Elasticsearch.Serverless.KnnSearch>? Knn { get; set; }

/// <summary>
/// <para>Minimum _score for matching documents. Documents with a lower _score are<br/>not included in the search results.</para>
Expand Down Expand Up @@ -1028,10 +1028,10 @@ public SubmitAsyncSearchRequestDescriptor<TDocument> Indices(Elastic.Clients.Ela
private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor<TDocument> HighlightDescriptor { get; set; }
private Action<Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor<TDocument>> HighlightDescriptorAction { get; set; }
private ICollection<IDictionary<Elastic.Clients.Elasticsearch.Serverless.IndexName, double>>? IndicesBoostValue { get; set; }
private ICollection<Elastic.Clients.Elasticsearch.Serverless.KnnQuery>? KnnValue { get; set; }
private Elastic.Clients.Elasticsearch.Serverless.KnnQueryDescriptor<TDocument> KnnDescriptor { get; set; }
private Action<Elastic.Clients.Elasticsearch.Serverless.KnnQueryDescriptor<TDocument>> KnnDescriptorAction { get; set; }
private Action<Elastic.Clients.Elasticsearch.Serverless.KnnQueryDescriptor<TDocument>>[] KnnDescriptorActions { get; set; }
private ICollection<Elastic.Clients.Elasticsearch.Serverless.KnnSearch>? KnnValue { get; set; }
private Elastic.Clients.Elasticsearch.Serverless.KnnSearchDescriptor<TDocument> KnnDescriptor { get; set; }
private Action<Elastic.Clients.Elasticsearch.Serverless.KnnSearchDescriptor<TDocument>> KnnDescriptorAction { get; set; }
private Action<Elastic.Clients.Elasticsearch.Serverless.KnnSearchDescriptor<TDocument>>[] KnnDescriptorActions { get; set; }
private double? MinScoreValue { get; set; }
private Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReference? PitValue { get; set; }
private Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReferenceDescriptor PitDescriptor { get; set; }
Expand Down Expand Up @@ -1242,7 +1242,7 @@ public SubmitAsyncSearchRequestDescriptor<TDocument> IndicesBoost(ICollection<ID
/// <summary>
/// <para>Defines the approximate kNN search to run.</para>
/// </summary>
public SubmitAsyncSearchRequestDescriptor<TDocument> Knn(ICollection<Elastic.Clients.Elasticsearch.Serverless.KnnQuery>? knn)
public SubmitAsyncSearchRequestDescriptor<TDocument> Knn(ICollection<Elastic.Clients.Elasticsearch.Serverless.KnnSearch>? knn)
{
KnnDescriptor = null;
KnnDescriptorAction = null;
Expand All @@ -1251,7 +1251,7 @@ public SubmitAsyncSearchRequestDescriptor<TDocument> Knn(ICollection<Elastic.Cli
return Self;
}

public SubmitAsyncSearchRequestDescriptor<TDocument> Knn(Elastic.Clients.Elasticsearch.Serverless.KnnQueryDescriptor<TDocument> descriptor)
public SubmitAsyncSearchRequestDescriptor<TDocument> Knn(Elastic.Clients.Elasticsearch.Serverless.KnnSearchDescriptor<TDocument> descriptor)
{
KnnValue = null;
KnnDescriptorAction = null;
Expand All @@ -1260,7 +1260,7 @@ public SubmitAsyncSearchRequestDescriptor<TDocument> Knn(Elastic.Clients.Elastic
return Self;
}

public SubmitAsyncSearchRequestDescriptor<TDocument> Knn(Action<Elastic.Clients.Elasticsearch.Serverless.KnnQueryDescriptor<TDocument>> configure)
public SubmitAsyncSearchRequestDescriptor<TDocument> Knn(Action<Elastic.Clients.Elasticsearch.Serverless.KnnSearchDescriptor<TDocument>> configure)
{
KnnValue = null;
KnnDescriptor = null;
Expand All @@ -1269,7 +1269,7 @@ public SubmitAsyncSearchRequestDescriptor<TDocument> Knn(Action<Elastic.Clients.
return Self;
}

public SubmitAsyncSearchRequestDescriptor<TDocument> Knn(params Action<Elastic.Clients.Elasticsearch.Serverless.KnnQueryDescriptor<TDocument>>[] configure)
public SubmitAsyncSearchRequestDescriptor<TDocument> Knn(params Action<Elastic.Clients.Elasticsearch.Serverless.KnnSearchDescriptor<TDocument>>[] configure)
{
KnnValue = null;
KnnDescriptor = null;
Expand Down Expand Up @@ -1740,7 +1740,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
else if (KnnDescriptorAction is not null)
{
writer.WritePropertyName("knn");
JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.KnnQueryDescriptor<TDocument>(KnnDescriptorAction), options);
JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.KnnSearchDescriptor<TDocument>(KnnDescriptorAction), options);
}
else if (KnnDescriptorActions is not null)
{
Expand All @@ -1749,7 +1749,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
writer.WriteStartArray();
foreach (var action in KnnDescriptorActions)
{
JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.KnnQueryDescriptor<TDocument>(action), options);
JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.KnnSearchDescriptor<TDocument>(action), options);
}

if (KnnDescriptorActions.Length != 1)
Expand All @@ -1758,7 +1758,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
else if (KnnValue is not null)
{
writer.WritePropertyName("knn");
SingleOrManySerializationHelper.Serialize<Elastic.Clients.Elasticsearch.Serverless.KnnQuery>(KnnValue, writer, options);
SingleOrManySerializationHelper.Serialize<Elastic.Clients.Elasticsearch.Serverless.KnnSearch>(KnnValue, writer, options);
}

if (MinScoreValue.HasValue)
Expand Down Expand Up @@ -2074,10 +2074,10 @@ public SubmitAsyncSearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch.
private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor HighlightDescriptor { get; set; }
private Action<Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor> HighlightDescriptorAction { get; set; }
private ICollection<IDictionary<Elastic.Clients.Elasticsearch.Serverless.IndexName, double>>? IndicesBoostValue { get; set; }
private ICollection<Elastic.Clients.Elasticsearch.Serverless.KnnQuery>? KnnValue { get; set; }
private Elastic.Clients.Elasticsearch.Serverless.KnnQueryDescriptor KnnDescriptor { get; set; }
private Action<Elastic.Clients.Elasticsearch.Serverless.KnnQueryDescriptor> KnnDescriptorAction { get; set; }
private Action<Elastic.Clients.Elasticsearch.Serverless.KnnQueryDescriptor>[] KnnDescriptorActions { get; set; }
private ICollection<Elastic.Clients.Elasticsearch.Serverless.KnnSearch>? KnnValue { get; set; }
private Elastic.Clients.Elasticsearch.Serverless.KnnSearchDescriptor KnnDescriptor { get; set; }
private Action<Elastic.Clients.Elasticsearch.Serverless.KnnSearchDescriptor> KnnDescriptorAction { get; set; }
private Action<Elastic.Clients.Elasticsearch.Serverless.KnnSearchDescriptor>[] KnnDescriptorActions { get; set; }
private double? MinScoreValue { get; set; }
private Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReference? PitValue { get; set; }
private Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReferenceDescriptor PitDescriptor { get; set; }
Expand Down Expand Up @@ -2288,7 +2288,7 @@ public SubmitAsyncSearchRequestDescriptor IndicesBoost(ICollection<IDictionary<E
/// <summary>
/// <para>Defines the approximate kNN search to run.</para>
/// </summary>
public SubmitAsyncSearchRequestDescriptor Knn(ICollection<Elastic.Clients.Elasticsearch.Serverless.KnnQuery>? knn)
public SubmitAsyncSearchRequestDescriptor Knn(ICollection<Elastic.Clients.Elasticsearch.Serverless.KnnSearch>? knn)
{
KnnDescriptor = null;
KnnDescriptorAction = null;
Expand All @@ -2297,7 +2297,7 @@ public SubmitAsyncSearchRequestDescriptor Knn(ICollection<Elastic.Clients.Elasti
return Self;
}

public SubmitAsyncSearchRequestDescriptor Knn(Elastic.Clients.Elasticsearch.Serverless.KnnQueryDescriptor descriptor)
public SubmitAsyncSearchRequestDescriptor Knn(Elastic.Clients.Elasticsearch.Serverless.KnnSearchDescriptor descriptor)
{
KnnValue = null;
KnnDescriptorAction = null;
Expand All @@ -2306,7 +2306,7 @@ public SubmitAsyncSearchRequestDescriptor Knn(Elastic.Clients.Elasticsearch.Serv
return Self;
}

public SubmitAsyncSearchRequestDescriptor Knn(Action<Elastic.Clients.Elasticsearch.Serverless.KnnQueryDescriptor> configure)
public SubmitAsyncSearchRequestDescriptor Knn(Action<Elastic.Clients.Elasticsearch.Serverless.KnnSearchDescriptor> configure)
{
KnnValue = null;
KnnDescriptor = null;
Expand All @@ -2315,7 +2315,7 @@ public SubmitAsyncSearchRequestDescriptor Knn(Action<Elastic.Clients.Elasticsear
return Self;
}

public SubmitAsyncSearchRequestDescriptor Knn(params Action<Elastic.Clients.Elasticsearch.Serverless.KnnQueryDescriptor>[] configure)
public SubmitAsyncSearchRequestDescriptor Knn(params Action<Elastic.Clients.Elasticsearch.Serverless.KnnSearchDescriptor>[] configure)
{
KnnValue = null;
KnnDescriptor = null;
Expand Down Expand Up @@ -2786,7 +2786,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
else if (KnnDescriptorAction is not null)
{
writer.WritePropertyName("knn");
JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.KnnQueryDescriptor(KnnDescriptorAction), options);
JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.KnnSearchDescriptor(KnnDescriptorAction), options);
}
else if (KnnDescriptorActions is not null)
{
Expand All @@ -2795,7 +2795,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
writer.WriteStartArray();
foreach (var action in KnnDescriptorActions)
{
JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.KnnQueryDescriptor(action), options);
JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.KnnSearchDescriptor(action), options);
}

if (KnnDescriptorActions.Length != 1)
Expand All @@ -2804,7 +2804,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
else if (KnnValue is not null)
{
writer.WritePropertyName("knn");
SingleOrManySerializationHelper.Serialize<Elastic.Clients.Elasticsearch.Serverless.KnnQuery>(KnnValue, writer, options);
SingleOrManySerializationHelper.Serialize<Elastic.Clients.Elasticsearch.Serverless.KnnSearch>(KnnValue, writer, options);
}

if (MinScoreValue.HasValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Cluster;

public sealed partial class PutComponentTemplateRequestParameters : RequestParameters
{
public string? Cause { get => Q<string?>("cause"); set => Q("cause", value); }

/// <summary>
/// <para>If `true`, this request cannot replace or update existing component templates.</para>
/// </summary>
Expand Down Expand Up @@ -63,6 +65,9 @@ public PutComponentTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Name

internal override string OperationName => "cluster.put_component_template";

[JsonIgnore]
public string? Cause { get => Q<string?>("cause"); set => Q("cause", value); }

/// <summary>
/// <para>If `true`, this request cannot replace or update existing component templates.</para>
/// </summary>
Expand All @@ -76,10 +81,10 @@ public PutComponentTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Name
public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q<Elastic.Clients.Elasticsearch.Serverless.Duration?>("master_timeout"); set => Q("master_timeout", value); }

/// <summary>
/// <para>This setting overrides the value of the `action.auto_create_index` cluster setting.<br/>If set to `true` in a template, then indices can be automatically created using that<br/>template even if auto-creation of indices is disabled via `actions.auto_create_index`.<br/>If set to `false` then data streams matching the template must always be explicitly created.</para>
/// <para>Marks this index template as deprecated. When creating or updating a non-deprecated index template<br/>that uses deprecated components, Elasticsearch will emit a deprecation warning.</para>
/// </summary>
[JsonInclude, JsonPropertyName("allow_auto_create")]
public bool? AllowAutoCreate { get; set; }
[JsonInclude, JsonPropertyName("deprecated")]
public bool? Deprecated { get; set; }

/// <summary>
/// <para>Optional user metadata about the component template.<br/>May have any contents. This map is not automatically generated by Elasticsearch.<br/>This information is stored in the cluster state, so keeping it short is preferable.<br/>To unset `_meta`, replace the template without specifying this information.</para>
Expand Down Expand Up @@ -123,6 +128,7 @@ public PutComponentTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serve

internal override string OperationName => "cluster.put_component_template";

public PutComponentTemplateRequestDescriptor<TDocument> Cause(string? cause) => Qs("cause", cause);
public PutComponentTemplateRequestDescriptor<TDocument> Create(bool? create = true) => Qs("create", create);
public PutComponentTemplateRequestDescriptor<TDocument> MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout);

Expand All @@ -132,19 +138,19 @@ public PutComponentTemplateRequestDescriptor<TDocument> Name(Elastic.Clients.Ela
return Self;
}

private bool? AllowAutoCreateValue { get; set; }
private bool? DeprecatedValue { get; set; }
private IDictionary<string, object>? MetaValue { get; set; }
private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexState TemplateValue { get; set; }
private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexStateDescriptor<TDocument> TemplateDescriptor { get; set; }
private Action<Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexStateDescriptor<TDocument>> TemplateDescriptorAction { get; set; }
private long? VersionValue { get; set; }

/// <summary>
/// <para>This setting overrides the value of the `action.auto_create_index` cluster setting.<br/>If set to `true` in a template, then indices can be automatically created using that<br/>template even if auto-creation of indices is disabled via `actions.auto_create_index`.<br/>If set to `false` then data streams matching the template must always be explicitly created.</para>
/// <para>Marks this index template as deprecated. When creating or updating a non-deprecated index template<br/>that uses deprecated components, Elasticsearch will emit a deprecation warning.</para>
/// </summary>
public PutComponentTemplateRequestDescriptor<TDocument> AllowAutoCreate(bool? allowAutoCreate = true)
public PutComponentTemplateRequestDescriptor<TDocument> Deprecated(bool? deprecated = true)
{
AllowAutoCreateValue = allowAutoCreate;
DeprecatedValue = deprecated;
return Self;
}

Expand Down Expand Up @@ -196,10 +202,10 @@ public PutComponentTemplateRequestDescriptor<TDocument> Version(long? version)
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
{
writer.WriteStartObject();
if (AllowAutoCreateValue.HasValue)
if (DeprecatedValue.HasValue)
{
writer.WritePropertyName("allow_auto_create");
writer.WriteBooleanValue(AllowAutoCreateValue.Value);
writer.WritePropertyName("deprecated");
writer.WriteBooleanValue(DeprecatedValue.Value);
}

if (MetaValue is not null)
Expand Down Expand Up @@ -257,6 +263,7 @@ public PutComponentTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serve

internal override string OperationName => "cluster.put_component_template";

public PutComponentTemplateRequestDescriptor Cause(string? cause) => Qs("cause", cause);
public PutComponentTemplateRequestDescriptor Create(bool? create = true) => Qs("create", create);
public PutComponentTemplateRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout);

Expand All @@ -266,19 +273,19 @@ public PutComponentTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.
return Self;
}

private bool? AllowAutoCreateValue { get; set; }
private bool? DeprecatedValue { get; set; }
private IDictionary<string, object>? MetaValue { get; set; }
private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexState TemplateValue { get; set; }
private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexStateDescriptor TemplateDescriptor { get; set; }
private Action<Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexStateDescriptor> TemplateDescriptorAction { get; set; }
private long? VersionValue { get; set; }

/// <summary>
/// <para>This setting overrides the value of the `action.auto_create_index` cluster setting.<br/>If set to `true` in a template, then indices can be automatically created using that<br/>template even if auto-creation of indices is disabled via `actions.auto_create_index`.<br/>If set to `false` then data streams matching the template must always be explicitly created.</para>
/// <para>Marks this index template as deprecated. When creating or updating a non-deprecated index template<br/>that uses deprecated components, Elasticsearch will emit a deprecation warning.</para>
/// </summary>
public PutComponentTemplateRequestDescriptor AllowAutoCreate(bool? allowAutoCreate = true)
public PutComponentTemplateRequestDescriptor Deprecated(bool? deprecated = true)
{
AllowAutoCreateValue = allowAutoCreate;
DeprecatedValue = deprecated;
return Self;
}

Expand Down Expand Up @@ -330,10 +337,10 @@ public PutComponentTemplateRequestDescriptor Version(long? version)
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
{
writer.WriteStartObject();
if (AllowAutoCreateValue.HasValue)
if (DeprecatedValue.HasValue)
{
writer.WritePropertyName("allow_auto_create");
writer.WriteBooleanValue(AllowAutoCreateValue.Value);
writer.WritePropertyName("deprecated");
writer.WriteBooleanValue(DeprecatedValue.Value);
}

if (MetaValue is not null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public sealed partial class CreateResponse : ElasticsearchResponse
[JsonInclude, JsonPropertyName("_index")]
public string Index { get; init; }
[JsonInclude, JsonPropertyName("_primary_term")]
public long PrimaryTerm { get; init; }
public long? PrimaryTerm { get; init; }
[JsonInclude, JsonPropertyName("result")]
public Elastic.Clients.Elasticsearch.Serverless.Result Result { get; init; }
[JsonInclude, JsonPropertyName("_seq_no")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public sealed partial class DeleteResponse : ElasticsearchResponse
[JsonInclude, JsonPropertyName("_index")]
public string Index { get; init; }
[JsonInclude, JsonPropertyName("_primary_term")]
public long PrimaryTerm { get; init; }
public long? PrimaryTerm { get; init; }
[JsonInclude, JsonPropertyName("result")]
public Elastic.Clients.Elasticsearch.Serverless.Result Result { get; init; }
[JsonInclude, JsonPropertyName("_seq_no")]
Expand Down

0 comments on commit c517b9d

Please sign in to comment.