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
@@ -0,0 +1,126 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using System;
using System.Linq;
using Elastic.Clients.Elasticsearch.Serialization;

namespace Elastic.Clients.Elasticsearch.Fluent;

public readonly partial struct FluentCollectionOfKeyValuePairOfStringCompositeAggregationSource<TDocument>
{
private readonly System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>> _items = new();

private System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>> Value => _items;

public FluentCollectionOfKeyValuePairOfStringCompositeAggregationSource()
{
}

public Elastic.Clients.Elasticsearch.Fluent.FluentCollectionOfKeyValuePairOfStringCompositeAggregationSource<TDocument> Add(System.Collections.Generic.KeyValuePair<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource> value)
{
_items.Add(value);
return this;
}

public Elastic.Clients.Elasticsearch.Fluent.FluentCollectionOfKeyValuePairOfStringCompositeAggregationSource<TDocument> Add(params System.Collections.Generic.KeyValuePair<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>[] values)
{
_items.AddRange(values);
return this;
}

public Elastic.Clients.Elasticsearch.Fluent.FluentCollectionOfKeyValuePairOfStringCompositeAggregationSource<TDocument> Add(string key, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource value)
{
_items.Add(new System.Collections.Generic.KeyValuePair<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>(key, value));
return this;
}

public Elastic.Clients.Elasticsearch.Fluent.FluentCollectionOfKeyValuePairOfStringCompositeAggregationSource<TDocument> Add(string key, System.Action<Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSourceDescriptor<TDocument>> action)
{
_items.Add(new System.Collections.Generic.KeyValuePair<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>(key, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSourceDescriptor<TDocument>.Build(action)));
return this;
}

[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
internal static System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>> Build(System.Action<Elastic.Clients.Elasticsearch.Fluent.FluentCollectionOfKeyValuePairOfStringCompositeAggregationSource<TDocument>>? action)
{
if (action is null)
{
return [];
}

var builder = new Elastic.Clients.Elasticsearch.Fluent.FluentCollectionOfKeyValuePairOfStringCompositeAggregationSource<TDocument>();
action.Invoke(builder);
return builder.Value;
}
}

public readonly partial struct FluentCollectionOfKeyValuePairOfStringCompositeAggregationSource
{
private readonly System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>> _items = new();

private System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>> Value => _items;

public FluentCollectionOfKeyValuePairOfStringCompositeAggregationSource()
{
}

public Elastic.Clients.Elasticsearch.Fluent.FluentCollectionOfKeyValuePairOfStringCompositeAggregationSource Add(System.Collections.Generic.KeyValuePair<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource> value)
{
_items.Add(value);
return this;
}

public Elastic.Clients.Elasticsearch.Fluent.FluentCollectionOfKeyValuePairOfStringCompositeAggregationSource Add(params System.Collections.Generic.KeyValuePair<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>[] values)
{
_items.AddRange(values);
return this;
}

public Elastic.Clients.Elasticsearch.Fluent.FluentCollectionOfKeyValuePairOfStringCompositeAggregationSource Add(string key, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource value)
{
_items.Add(new System.Collections.Generic.KeyValuePair<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>(key, value));
return this;
}

public Elastic.Clients.Elasticsearch.Fluent.FluentCollectionOfKeyValuePairOfStringCompositeAggregationSource Add(string key, System.Action<Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSourceDescriptor> action)
{
_items.Add(new System.Collections.Generic.KeyValuePair<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>(key, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSourceDescriptor.Build(action)));
return this;
}

public Elastic.Clients.Elasticsearch.Fluent.FluentCollectionOfKeyValuePairOfStringCompositeAggregationSource Add<T>(string key, System.Action<Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSourceDescriptor<T>> action)
{
_items.Add(new System.Collections.Generic.KeyValuePair<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>(key, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSourceDescriptor<T>.Build(action)));
return this;
}

[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
internal static System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>> Build(System.Action<Elastic.Clients.Elasticsearch.Fluent.FluentCollectionOfKeyValuePairOfStringCompositeAggregationSource>? action)
{
if (action is null)
{
return [];
}

var builder = new Elastic.Clients.Elasticsearch.Fluent.FluentCollectionOfKeyValuePairOfStringCompositeAggregationSource();
action.Invoke(builder);
return builder.Value;
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregation
reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
LocalJsonValue<System.Collections.Generic.IDictionary<Elastic.Clients.Elasticsearch.Field, Elastic.Clients.Elasticsearch.FieldValue>?> propAfter = default;
LocalJsonValue<int?> propSize = default;
LocalJsonValue<System.Collections.Generic.ICollection<System.Collections.Generic.IDictionary<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>>?> propSources = default;
LocalJsonValue<System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>>?> propSources = default;
while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
{
if (propAfter.TryReadProperty(ref reader, options, PropAfter, static System.Collections.Generic.IDictionary<Elastic.Clients.Elasticsearch.Field, Elastic.Clients.Elasticsearch.FieldValue>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue<Elastic.Clients.Elasticsearch.Field, Elastic.Clients.Elasticsearch.FieldValue>(o, null, null)))
Expand All @@ -47,7 +47,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregation
continue;
}

if (propSources.TryReadProperty(ref reader, options, PropSources, static System.Collections.Generic.ICollection<System.Collections.Generic.IDictionary<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue<System.Collections.Generic.IDictionary<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>>(o, static System.Collections.Generic.IDictionary<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>(o, null, null)!)))
if (propSources.TryReadProperty(ref reader, options, PropSources, static System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue<System.Collections.Generic.KeyValuePair<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>>(o, static System.Collections.Generic.KeyValuePair<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>(o, null, null))))
{
continue;
}
Expand Down Expand Up @@ -75,7 +75,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien
writer.WriteStartObject();
writer.WriteProperty(options, PropAfter, value.After, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary<Elastic.Clients.Elasticsearch.Field, Elastic.Clients.Elasticsearch.FieldValue>? v) => w.WriteDictionaryValue<Elastic.Clients.Elasticsearch.Field, Elastic.Clients.Elasticsearch.FieldValue>(o, v, null, null));
writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue<int>(o, v));
writer.WriteProperty(options, PropSources, value.Sources, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection<System.Collections.Generic.IDictionary<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>>? v) => w.WriteCollectionValue<System.Collections.Generic.IDictionary<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource> v) => w.WriteDictionaryValue<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>(o, v, null, null)));
writer.WriteProperty(options, PropSources, value.Sources, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>>? v) => w.WriteCollectionValue<System.Collections.Generic.KeyValuePair<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource> v) => w.WriteKeyValuePairValue<string, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource>(o, v, null, null)));
writer.WriteEndObject();
}
}
Loading
Loading