Skip to content
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 @@ -46,7 +46,7 @@ public override Elastic.Clients.Elasticsearch.TransformManagement.UpdateTransfor
LocalJsonValue<Elastic.Clients.Elasticsearch.MachineLearning.TransformAuthorization?> propAuthorization = default;
LocalJsonValue<long> propCreateTime = default;
LocalJsonValue<string> propDescription = default;
LocalJsonValue<Elastic.Clients.Elasticsearch.Core.Reindex.Destination> propDest = default;
LocalJsonValue<Elastic.Clients.Elasticsearch.TransformManagement.Destination> propDest = default;
LocalJsonValue<Elastic.Clients.Elasticsearch.Duration?> propFrequency = default;
LocalJsonValue<string> propId = default;
LocalJsonValue<Elastic.Clients.Elasticsearch.TransformManagement.Latest?> propLatest = default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ internal UpdateTransformResponse(Elastic.Clients.Elasticsearch.Serialization.Jso
public Elastic.Clients.Elasticsearch.MachineLearning.TransformAuthorization? Authorization { get; set; }
public required long CreateTime { get; set; }
public required string Description { get; set; }
public required Elastic.Clients.Elasticsearch.Core.Reindex.Destination Dest { get; set; }
public required Elastic.Clients.Elasticsearch.TransformManagement.Destination Dest { get; set; }
public Elastic.Clients.Elasticsearch.Duration? Frequency { get; set; }
public required string Id { get; set; }
public Elastic.Clients.Elasticsearch.TransformManagement.Latest? Latest { get; set; }
Expand Down
4,175 changes: 2,091 additions & 2,084 deletions src/Elastic.Clients.Elasticsearch/_Generated/SpecReferences.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public override Elastic.Clients.Elasticsearch.KnnRetriever Read(ref System.Text.
LocalJsonValue<int> propK = default;
LocalJsonValue<float?> propMinScore = default;
LocalJsonValue<string?> propName = default;
LocalJsonValue<int> propNumCandidates = default;
LocalJsonValue<int?> propNumCandidates = default;
LocalJsonValue<System.Collections.Generic.ICollection<float>?> propQueryVector = default;
LocalJsonValue<Elastic.Clients.Elasticsearch.QueryVectorBuilder?> propQueryVectorBuilder = default;
LocalJsonValue<Elastic.Clients.Elasticsearch.RescoreVector?> propRescoreVector = default;
Expand Down Expand Up @@ -76,7 +76,7 @@ public override Elastic.Clients.Elasticsearch.KnnRetriever Read(ref System.Text.
continue;
}

if (propNumCandidates.TryReadProperty(ref reader, options, PropNumCandidates, null))
if (propNumCandidates.TryReadProperty(ref reader, options, PropNumCandidates, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue<int>(o)))
{
continue;
}
Expand Down Expand Up @@ -134,7 +134,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien
writer.WriteProperty(options, PropK, value.K, null, null);
writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue<float>(o, v));
writer.WriteProperty(options, PropName, value.Name, null, null);
writer.WriteProperty(options, PropNumCandidates, value.NumCandidates, null, null);
writer.WriteProperty(options, PropNumCandidates, value.NumCandidates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue<int>(o, v));
writer.WriteProperty(options, PropQueryVector, value.QueryVector, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection<float>? v) => w.WriteCollectionValue<float>(o, v, null));
writer.WriteProperty(options, PropQueryVectorBuilder, value.QueryVectorBuilder, null, null);
writer.WriteProperty(options, PropRescoreVector, value.RescoreVector, null, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@ namespace Elastic.Clients.Elasticsearch;
public sealed partial class KnnRetriever
{
[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
public KnnRetriever(string field, int k, int numCandidates)
public KnnRetriever(string field, int k)
{
Field = field;
K = k;
NumCandidates = numCandidates;
}

public KnnRetriever()
Expand Down Expand Up @@ -61,7 +60,7 @@ internal KnnRetriever(Elastic.Clients.Elasticsearch.Serialization.JsonConstructo
public string? Name { get; set; }

/// <include file="KnnRetriever.g.xml" path="doc/member[@key='_types.KnnRetriever#num_candidates']/*"/>
public required int NumCandidates { get; set; }
public int? NumCandidates { get; set; }

/// <include file="KnnRetriever.g.xml" path="doc/member[@key='_types.KnnRetriever#query_vector']/*"/>
public System.Collections.Generic.ICollection<float>? QueryVector { get; set; }
Expand Down Expand Up @@ -152,7 +151,7 @@ public Elastic.Clients.Elasticsearch.KnnRetrieverDescriptor<TDocument> Name(stri
}

/// <include file="KnnRetriever.g.xml" path="doc/member[@key='_types.KnnRetriever#num_candidates']/*"/>
public Elastic.Clients.Elasticsearch.KnnRetrieverDescriptor<TDocument> NumCandidates(int value)
public Elastic.Clients.Elasticsearch.KnnRetrieverDescriptor<TDocument> NumCandidates(int? value)
{
Instance.NumCandidates = value;
return this;
Expand Down Expand Up @@ -305,7 +304,7 @@ public Elastic.Clients.Elasticsearch.KnnRetrieverDescriptor Name(string? value)
}

/// <include file="KnnRetriever.g.xml" path="doc/member[@key='_types.KnnRetriever#num_candidates']/*"/>
public Elastic.Clients.Elasticsearch.KnnRetrieverDescriptor NumCandidates(int value)
public Elastic.Clients.Elasticsearch.KnnRetrieverDescriptor NumCandidates(int? value)
{
Instance.NumCandidates = value;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,23 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement.Json;

public sealed partial class DestinationConverter : System.Text.Json.Serialization.JsonConverter<Elastic.Clients.Elasticsearch.TransformManagement.Destination>
{
private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"u8);
private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"u8);
private static readonly System.Text.Json.JsonEncodedText PropPipeline = System.Text.Json.JsonEncodedText.Encode("pipeline"u8);

public override Elastic.Clients.Elasticsearch.TransformManagement.Destination 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<Elastic.Clients.Elasticsearch.TransformManagement.DestinationAlias>?> propAliases = default;
LocalJsonValue<Elastic.Clients.Elasticsearch.IndexName?> propIndex = default;
LocalJsonValue<string?> propPipeline = default;
while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
{
if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.ICollection<Elastic.Clients.Elasticsearch.TransformManagement.DestinationAlias>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue<Elastic.Clients.Elasticsearch.TransformManagement.DestinationAlias>(o, null)))
{
continue;
}

if (propIndex.TryReadProperty(ref reader, options, PropIndex, null))
{
continue;
Expand All @@ -57,6 +64,7 @@ public override Elastic.Clients.Elasticsearch.TransformManagement.Destination Re
reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject);
return new Elastic.Clients.Elasticsearch.TransformManagement.Destination(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)
{
Aliases = propAliases.Value,
Index = propIndex.Value,
Pipeline = propPipeline.Value
};
Expand All @@ -65,6 +73,7 @@ public override Elastic.Clients.Elasticsearch.TransformManagement.Destination Re
public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.Destination value, System.Text.Json.JsonSerializerOptions options)
{
writer.WriteStartObject();
writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection<Elastic.Clients.Elasticsearch.TransformManagement.DestinationAlias>? v) => w.WriteCollectionValue<Elastic.Clients.Elasticsearch.TransformManagement.DestinationAlias>(o, v, null));
writer.WriteProperty(options, PropIndex, value.Index, null, null);
writer.WriteProperty(options, PropPipeline, value.Pipeline, null, null);
writer.WriteEndObject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ internal Destination(Elastic.Clients.Elasticsearch.Serialization.JsonConstructor
_ = sentinel;
}

/// <include file="Destination.g.xml" path="doc/member[@key='transform._types.Destination#aliases']/*"/>
public System.Collections.Generic.ICollection<Elastic.Clients.Elasticsearch.TransformManagement.DestinationAlias>? Aliases { get; set; }

/// <include file="Destination.g.xml" path="doc/member[@key='transform._types.Destination#index']/*"/>
public Elastic.Clients.Elasticsearch.IndexName? Index { get; set; }

Expand Down Expand Up @@ -64,6 +67,33 @@ public DestinationDescriptor()
public static explicit operator Elastic.Clients.Elasticsearch.TransformManagement.DestinationDescriptor(Elastic.Clients.Elasticsearch.TransformManagement.Destination instance) => new Elastic.Clients.Elasticsearch.TransformManagement.DestinationDescriptor(instance);
public static implicit operator Elastic.Clients.Elasticsearch.TransformManagement.Destination(Elastic.Clients.Elasticsearch.TransformManagement.DestinationDescriptor descriptor) => descriptor.Instance;

/// <include file="Destination.g.xml" path="doc/member[@key='transform._types.Destination#aliases']/*"/>
public Elastic.Clients.Elasticsearch.TransformManagement.DestinationDescriptor Aliases(System.Collections.Generic.ICollection<Elastic.Clients.Elasticsearch.TransformManagement.DestinationAlias>? value)
{
Instance.Aliases = value;
return this;
}

/// <include file="Destination.g.xml" path="doc/member[@key='transform._types.Destination#aliases']/*"/>
public Elastic.Clients.Elasticsearch.TransformManagement.DestinationDescriptor Aliases(params Elastic.Clients.Elasticsearch.TransformManagement.DestinationAlias[] values)
{
Instance.Aliases = [.. values];
return this;
}

/// <include file="Destination.g.xml" path="doc/member[@key='transform._types.Destination#aliases']/*"/>
public Elastic.Clients.Elasticsearch.TransformManagement.DestinationDescriptor Aliases(params System.Action<Elastic.Clients.Elasticsearch.TransformManagement.DestinationAliasDescriptor>[] actions)
{
var items = new System.Collections.Generic.List<Elastic.Clients.Elasticsearch.TransformManagement.DestinationAlias>();
foreach (var action in actions)
{
items.Add(Elastic.Clients.Elasticsearch.TransformManagement.DestinationAliasDescriptor.Build(action));
}

Instance.Aliases = items;
return this;
}

/// <include file="Destination.g.xml" path="doc/member[@key='transform._types.Destination#index']/*"/>
public Elastic.Clients.Elasticsearch.TransformManagement.DestinationDescriptor Index(Elastic.Clients.Elasticsearch.IndexName? value)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<doc>
<member key="transform._types.Destination#aliases"><summary><para>
The aliases that the destination index for the transform should have.
Aliases are manipulated using the stored credentials of the transform, which means the secondary credentials
supplied at creation time (if both primary and secondary credentials are specified).
</para>
<para>
The destination index is added to the aliases regardless of whether the destination index was created by the
transform or pre-created by the user.
</para></summary></member>
<member key="transform._types.Destination#index"><summary><para>
The destination index for the transform. The mappings of the destination index are deduced based on the source
fields when possible. If alternate mappings are required, use the create index API prior to starting the
Expand Down
Original file line number Diff line number Diff line change
@@ -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.TransformManagement.Json;

public sealed partial class DestinationAliasConverter : System.Text.Json.Serialization.JsonConverter<Elastic.Clients.Elasticsearch.TransformManagement.DestinationAlias>
{
private static readonly System.Text.Json.JsonEncodedText PropAlias = System.Text.Json.JsonEncodedText.Encode("alias"u8);
private static readonly System.Text.Json.JsonEncodedText PropMoveOnCreation = System.Text.Json.JsonEncodedText.Encode("move_on_creation"u8);

public override Elastic.Clients.Elasticsearch.TransformManagement.DestinationAlias Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
{
reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
LocalJsonValue<Elastic.Clients.Elasticsearch.IndexAlias> propAlias = default;
LocalJsonValue<bool?> propMoveOnCreation = default;
while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
{
if (propAlias.TryReadProperty(ref reader, options, PropAlias, null))
{
continue;
}

if (propMoveOnCreation.TryReadProperty(ref reader, options, PropMoveOnCreation, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue<bool>(o)))
{
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.TransformManagement.DestinationAlias(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)
{
Alias = propAlias.Value,
MoveOnCreation = propMoveOnCreation.Value
};
}

public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.DestinationAlias value, System.Text.Json.JsonSerializerOptions options)
{
writer.WriteStartObject();
writer.WriteProperty(options, PropAlias, value.Alias, null, null);
writer.WriteProperty(options, PropMoveOnCreation, value.MoveOnCreation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue<bool>(o, v));
writer.WriteEndObject();
}
}
Loading
Loading