Skip to content

Commit

Permalink
Use Fields type for Field|Field[] and Field[] (#8084)
Browse files Browse the repository at this point in the history
  • Loading branch information
flobernd committed Apr 5, 2024
1 parent 8db7bd4 commit 1022a81
Show file tree
Hide file tree
Showing 124 changed files with 251 additions and 72 deletions.
Expand Up @@ -911,6 +911,7 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// <para>List of stored fields to return as part of a hit. If no fields are specified,<br/>no stored fields are included in the response. If this field is specified, the _source<br/>parameter defaults to false. You can pass _source: true to return both source fields<br/>and stored fields in the search response.</para>
/// </summary>
[JsonInclude, JsonPropertyName("stored_fields")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFields { get; set; }
[JsonInclude, JsonPropertyName("suggest")]
public Elastic.Clients.Elasticsearch.Serverless.Core.Search.Suggester? Suggest { get; set; }
Expand Down
Expand Up @@ -134,6 +134,7 @@ public FieldCapsRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indice
/// <para>List of fields to retrieve capabilities for. Wildcard (`*`) expressions are supported.</para>
/// </summary>
[JsonInclude, JsonPropertyName("fields")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? Fields { get; set; }

/// <summary>
Expand Down
Expand Up @@ -79,6 +79,7 @@ public SearchMvtRequest(Elastic.Clients.Elasticsearch.Serverless.Indices indices
/// <para>Fields to return in the `hits` layer. Supports wildcards (`*`).<br/>This parameter does not support fields with array values. Fields with array<br/>values may return inconsistent results.</para>
/// </summary>
[JsonInclude, JsonPropertyName("fields")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? Fields { get; set; }

/// <summary>
Expand Down
Expand Up @@ -956,6 +956,7 @@ public SearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices)
/// <para>List of stored fields to return as part of a hit.<br/>If no fields are specified, no stored fields are included in the response.<br/>If this field is specified, the `_source` parameter defaults to `false`.<br/>You can pass `_source: true` to return both source fields and stored fields in the search response.</para>
/// </summary>
[JsonInclude, JsonPropertyName("stored_fields")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFields { get; set; }

/// <summary>
Expand Down
Expand Up @@ -33,6 +33,7 @@ public sealed partial class MatrixStatsAggregation
/// <para>An array of fields for computing the statistics.</para>
/// </summary>
[JsonInclude, JsonPropertyName("fields")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? Fields { get; set; }
[JsonInclude, JsonPropertyName("meta")]
public IDictionary<string, object>? Meta { get; set; }
Expand Down
Expand Up @@ -133,6 +133,7 @@ public sealed partial class SignificantTextAggregation
/// <para>Overrides the JSON `_source` fields from which text will be analyzed.</para>
/// </summary>
[JsonInclude, JsonPropertyName("source_fields")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceFields { get; set; }

public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(SignificantTextAggregation significantTextAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.SignificantText(significantTextAggregation);
Expand Down
Expand Up @@ -33,6 +33,7 @@ public sealed partial class TopHitsAggregation
/// <para>Fields for which to return doc values.</para>
/// </summary>
[JsonInclude, JsonPropertyName("docvalue_fields")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? DocvalueFields { get; set; }

/// <summary>
Expand Down Expand Up @@ -102,6 +103,7 @@ public sealed partial class TopHitsAggregation
/// <para>Returns values for the specified stored fields (fields that use the `store` mapping option).</para>
/// </summary>
[JsonInclude, JsonPropertyName("stored_fields")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFields { get; set; }

/// <summary>
Expand Down
Expand Up @@ -57,6 +57,7 @@ public sealed partial class MultiGetOperation
/// <para>The stored fields you want to retrieve.</para>
/// </summary>
[JsonInclude, JsonPropertyName("stored_fields")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFields { get; set; }
[JsonInclude, JsonPropertyName("version")]
public long? Version { get; set; }
Expand Down
Expand Up @@ -39,6 +39,7 @@ public sealed partial class MultiTermVectorsOperation
/// <para>Comma-separated list or wildcard expressions of fields to include in the statistics.<br/>Used as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters.</para>
/// </summary>
[JsonInclude, JsonPropertyName("fields")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? Fields { get; set; }

/// <summary>
Expand Down
Expand Up @@ -68,6 +68,7 @@ public sealed partial class Source
/// <para>If `true` reindexes all source fields.<br/>Set to a list to reindex select fields.</para>
/// </summary>
[JsonInclude, JsonPropertyName("_source")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceFields { get; set; }
}

Expand Down
Expand Up @@ -78,6 +78,7 @@ public sealed partial class HighlightField
[JsonInclude, JsonPropertyName("highlight_query")]
public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? HighlightQuery { get; set; }
[JsonInclude, JsonPropertyName("matched_fields")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? MatchedFields { get; set; }

/// <summary>
Expand Down
Expand Up @@ -36,6 +36,7 @@ public sealed partial class InnerHits
[JsonInclude, JsonPropertyName("explain")]
public bool? Explain { get; set; }
[JsonInclude, JsonPropertyName("fields")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? Fields { get; set; }

/// <summary>
Expand Down Expand Up @@ -73,6 +74,7 @@ public sealed partial class InnerHits
[JsonInclude, JsonPropertyName("_source")]
public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? Source { get; set; }
[JsonInclude, JsonPropertyName("stored_fields")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFields { get; set; }
[JsonInclude, JsonPropertyName("track_scores")]
public bool? TrackScores { get; set; }
Expand Down
Expand Up @@ -32,6 +32,7 @@ public sealed partial class EnrichPolicy
[JsonInclude, JsonPropertyName("elasticsearch_version")]
public string? ElasticsearchVersion { get; set; }
[JsonInclude, JsonPropertyName("enrich_fields")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields EnrichFields { get; set; }
[JsonInclude, JsonPropertyName("indices")]
public Elastic.Clients.Elasticsearch.Serverless.Indices Indices { get; set; }
Expand Down
Expand Up @@ -30,6 +30,7 @@ namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement;
public sealed partial class IndexSegmentSort
{
[JsonInclude, JsonPropertyName("field")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? Field { get; set; }
[JsonInclude, JsonPropertyName("missing")]
[SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SegmentSortMissing))]
Expand Down
Expand Up @@ -93,6 +93,7 @@ public sealed partial class CsvProcessor
/// <para>The array of fields to assign extracted values to.</para>
/// </summary>
[JsonInclude, JsonPropertyName("target_fields")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields TargetFields { get; set; }

/// <summary>
Expand Down
Expand Up @@ -39,6 +39,7 @@ public sealed partial class RemoveProcessor
/// <para>Fields to be removed. Supports template snippets.</para>
/// </summary>
[JsonInclude, JsonPropertyName("field")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields Field { get; set; }

/// <summary>
Expand Down
Expand Up @@ -63,7 +63,8 @@ public sealed partial class AnalysisConfig
/// <para>A comma separated list of influencer field names. Typically these can be the by, over, or partition fields that are used in the detector configuration. You might also want to use a field name that is not specifically named in a detector, but is available as part of the input data. When you use multiple detectors, the use of influencers is recommended as it aggregates results for each influencer entity.</para>
/// </summary>
[JsonInclude, JsonPropertyName("influencers")]
public ICollection<Elastic.Clients.Elasticsearch.Serverless.Field>? Influencers { get; set; }
[JsonConverter(typeof(FieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? Influencers { get; set; }

/// <summary>
/// <para>The size of the window in which to expect data that is out of time order. If you specify a non-zero value, it must be greater than or equal to one second. NOTE: Latency is applicable only when you send data by using the post data API.</para>
Expand Down Expand Up @@ -112,7 +113,7 @@ public AnalysisConfigDescriptor() : base()
private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectorDescriptor<TDocument> DetectorsDescriptor { get; set; }
private Action<Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectorDescriptor<TDocument>> DetectorsDescriptorAction { get; set; }
private Action<Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectorDescriptor<TDocument>>[] DetectorsDescriptorActions { get; set; }
private ICollection<Elastic.Clients.Elasticsearch.Serverless.Field>? InfluencersValue { get; set; }
private Elastic.Clients.Elasticsearch.Serverless.Fields? InfluencersValue { get; set; }
private Elastic.Clients.Elasticsearch.Serverless.Duration? LatencyValue { get; set; }
private Elastic.Clients.Elasticsearch.Serverless.Duration? ModelPruneWindowValue { get; set; }
private bool? MultivariateByFieldsValue { get; set; }
Expand Down Expand Up @@ -217,7 +218,7 @@ public AnalysisConfigDescriptor<TDocument> Detectors(params Action<Elastic.Clien
/// <summary>
/// <para>A comma separated list of influencer field names. Typically these can be the by, over, or partition fields that are used in the detector configuration. You might also want to use a field name that is not specifically named in a detector, but is available as part of the input data. When you use multiple detectors, the use of influencers is recommended as it aggregates results for each influencer entity.</para>
/// </summary>
public AnalysisConfigDescriptor<TDocument> Influencers(ICollection<Elastic.Clients.Elasticsearch.Serverless.Field>? influencers)
public AnalysisConfigDescriptor<TDocument> Influencers(Elastic.Clients.Elasticsearch.Serverless.Fields? influencers)
{
InfluencersValue = influencers;
return Self;
Expand Down Expand Up @@ -428,7 +429,7 @@ public AnalysisConfigDescriptor() : base()
private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectorDescriptor DetectorsDescriptor { get; set; }
private Action<Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectorDescriptor> DetectorsDescriptorAction { get; set; }
private Action<Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectorDescriptor>[] DetectorsDescriptorActions { get; set; }
private ICollection<Elastic.Clients.Elasticsearch.Serverless.Field>? InfluencersValue { get; set; }
private Elastic.Clients.Elasticsearch.Serverless.Fields? InfluencersValue { get; set; }
private Elastic.Clients.Elasticsearch.Serverless.Duration? LatencyValue { get; set; }
private Elastic.Clients.Elasticsearch.Serverless.Duration? ModelPruneWindowValue { get; set; }
private bool? MultivariateByFieldsValue { get; set; }
Expand Down Expand Up @@ -533,7 +534,7 @@ public AnalysisConfigDescriptor Detectors(params Action<Elastic.Clients.Elastics
/// <summary>
/// <para>A comma separated list of influencer field names. Typically these can be the by, over, or partition fields that are used in the detector configuration. You might also want to use a field name that is not specifically named in a detector, but is available as part of the input data. When you use multiple detectors, the use of influencers is recommended as it aggregates results for each influencer entity.</para>
/// </summary>
public AnalysisConfigDescriptor Influencers(ICollection<Elastic.Clients.Elasticsearch.Serverless.Field>? influencers)
public AnalysisConfigDescriptor Influencers(Elastic.Clients.Elasticsearch.Serverless.Fields? influencers)
{
InfluencersValue = influencers;
return Self;
Expand Down
Expand Up @@ -30,6 +30,7 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Mapping;
public sealed partial class BinaryProperty : IProperty
{
[JsonInclude, JsonPropertyName("copy_to")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; }
[JsonInclude, JsonPropertyName("doc_values")]
public bool? DocValues { get; set; }
Expand Down
Expand Up @@ -32,6 +32,7 @@ public sealed partial class BooleanProperty : IProperty
[JsonInclude, JsonPropertyName("boost")]
public double? Boost { get; set; }
[JsonInclude, JsonPropertyName("copy_to")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; }
[JsonInclude, JsonPropertyName("doc_values")]
public bool? DocValues { get; set; }
Expand Down
Expand Up @@ -34,6 +34,7 @@ public sealed partial class ByteNumberProperty : IProperty
[JsonInclude, JsonPropertyName("coerce")]
public bool? Coerce { get; set; }
[JsonInclude, JsonPropertyName("copy_to")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; }
[JsonInclude, JsonPropertyName("doc_values")]
public bool? DocValues { get; set; }
Expand Down
Expand Up @@ -34,6 +34,7 @@ public sealed partial class CompletionProperty : IProperty
[JsonInclude, JsonPropertyName("contexts")]
public ICollection<Elastic.Clients.Elasticsearch.Serverless.Mapping.SuggestContext>? Contexts { get; set; }
[JsonInclude, JsonPropertyName("copy_to")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; }
[JsonInclude, JsonPropertyName("doc_values")]
public bool? DocValues { get; set; }
Expand Down
Expand Up @@ -32,6 +32,7 @@ public sealed partial class DateNanosProperty : IProperty
[JsonInclude, JsonPropertyName("boost")]
public double? Boost { get; set; }
[JsonInclude, JsonPropertyName("copy_to")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; }
[JsonInclude, JsonPropertyName("doc_values")]
public bool? DocValues { get; set; }
Expand Down
Expand Up @@ -32,6 +32,7 @@ public sealed partial class DateProperty : IProperty
[JsonInclude, JsonPropertyName("boost")]
public double? Boost { get; set; }
[JsonInclude, JsonPropertyName("copy_to")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; }
[JsonInclude, JsonPropertyName("doc_values")]
public bool? DocValues { get; set; }
Expand Down
Expand Up @@ -34,6 +34,7 @@ public sealed partial class DateRangeProperty : IProperty
[JsonInclude, JsonPropertyName("coerce")]
public bool? Coerce { get; set; }
[JsonInclude, JsonPropertyName("copy_to")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; }
[JsonInclude, JsonPropertyName("doc_values")]
public bool? DocValues { get; set; }
Expand Down
Expand Up @@ -34,6 +34,7 @@ public sealed partial class DoubleNumberProperty : IProperty
[JsonInclude, JsonPropertyName("coerce")]
public bool? Coerce { get; set; }
[JsonInclude, JsonPropertyName("copy_to")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; }
[JsonInclude, JsonPropertyName("doc_values")]
public bool? DocValues { get; set; }
Expand Down
Expand Up @@ -34,6 +34,7 @@ public sealed partial class DoubleRangeProperty : IProperty
[JsonInclude, JsonPropertyName("coerce")]
public bool? Coerce { get; set; }
[JsonInclude, JsonPropertyName("copy_to")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; }
[JsonInclude, JsonPropertyName("doc_values")]
public bool? DocValues { get; set; }
Expand Down
Expand Up @@ -36,6 +36,7 @@ public sealed partial class DynamicProperty : IProperty
[JsonInclude, JsonPropertyName("coerce")]
public bool? Coerce { get; set; }
[JsonInclude, JsonPropertyName("copy_to")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; }
[JsonInclude, JsonPropertyName("doc_values")]
public bool? DocValues { get; set; }
Expand Down
Expand Up @@ -34,6 +34,7 @@ public sealed partial class FloatNumberProperty : IProperty
[JsonInclude, JsonPropertyName("coerce")]
public bool? Coerce { get; set; }
[JsonInclude, JsonPropertyName("copy_to")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; }
[JsonInclude, JsonPropertyName("doc_values")]
public bool? DocValues { get; set; }
Expand Down
Expand Up @@ -34,6 +34,7 @@ public sealed partial class FloatRangeProperty : IProperty
[JsonInclude, JsonPropertyName("coerce")]
public bool? Coerce { get; set; }
[JsonInclude, JsonPropertyName("copy_to")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; }
[JsonInclude, JsonPropertyName("doc_values")]
public bool? DocValues { get; set; }
Expand Down
Expand Up @@ -30,6 +30,7 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Mapping;
public sealed partial class GeoPointProperty : IProperty
{
[JsonInclude, JsonPropertyName("copy_to")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; }
[JsonInclude, JsonPropertyName("doc_values")]
public bool? DocValues { get; set; }
Expand Down
Expand Up @@ -36,6 +36,7 @@ public sealed partial class GeoShapeProperty : IProperty
[JsonInclude, JsonPropertyName("coerce")]
public bool? Coerce { get; set; }
[JsonInclude, JsonPropertyName("copy_to")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; }
[JsonInclude, JsonPropertyName("doc_values")]
public bool? DocValues { get; set; }
Expand Down
Expand Up @@ -34,6 +34,7 @@ public sealed partial class HalfFloatNumberProperty : IProperty
[JsonInclude, JsonPropertyName("coerce")]
public bool? Coerce { get; set; }
[JsonInclude, JsonPropertyName("copy_to")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; }
[JsonInclude, JsonPropertyName("doc_values")]
public bool? DocValues { get; set; }
Expand Down
Expand Up @@ -34,6 +34,7 @@ public sealed partial class IntegerNumberProperty : IProperty
[JsonInclude, JsonPropertyName("coerce")]
public bool? Coerce { get; set; }
[JsonInclude, JsonPropertyName("copy_to")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; }
[JsonInclude, JsonPropertyName("doc_values")]
public bool? DocValues { get; set; }
Expand Down
Expand Up @@ -34,6 +34,7 @@ public sealed partial class IntegerRangeProperty : IProperty
[JsonInclude, JsonPropertyName("coerce")]
public bool? Coerce { get; set; }
[JsonInclude, JsonPropertyName("copy_to")]
[JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? CopyTo { get; set; }
[JsonInclude, JsonPropertyName("doc_values")]
public bool? DocValues { get; set; }
Expand Down

0 comments on commit 1022a81

Please sign in to comment.