Skip to content

Commit e73184f

Browse files
Container variant improvements (#6460) (#6464)
* Support name on containers and use for serialisation * Remove old POC types and IContainer interface * Remove variant name from variants * Remove unused future types Co-authored-by: Steve Gordon <[email protected]>
1 parent d7c01ed commit e73184f

File tree

161 files changed

+1203
-1204
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+1203
-1204
lines changed

src/Elastic.Clients.Elasticsearch/Common/Containers/ContainerAndVariantBase.cs

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/Elastic.Clients.Elasticsearch/Common/Containers/ContainerBase.cs

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/Elastic.Clients.Elasticsearch/Common/Containers/ContainerVariantBase.cs

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/Elastic.Clients.Elasticsearch/Common/Containers/IContainer.cs

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/Elastic.Clients.Elasticsearch/Common/Containers/IContainerVariant.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/Elastic.Clients.Elasticsearch/Common/Containers/VariantDescriptorBase.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/Elastic.Clients.Elasticsearch/FutureGenerated/FutureGenerated.cs

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,58 +5,16 @@
55
using System.Collections.Generic;
66
using System.Text.Json.Serialization;
77

8-
98
namespace Elastic.Clients.Elasticsearch.QueryDsl
109
{
11-
// TODO - Generate more of these?
10+
// TODO - Generate these
1211
public partial class TermQuery
1312
{
14-
public static implicit operator QueryContainer(TermQuery termQuery) => new(termQuery);
13+
public static implicit operator QueryContainer(TermQuery termQuery) => QueryContainer.Term(termQuery);
1514
}
1615

1716
public partial class MatchAllQuery
1817
{
19-
public static implicit operator QueryContainer(MatchAllQuery matchAllQuery) => new(matchAllQuery);
20-
}
21-
22-
public partial class QueryContainer
23-
{
24-
// TODO - Generate more of these!
25-
public TermQuery Term => Variant as TermQuery;
18+
public static implicit operator QueryContainer(MatchAllQuery matchAllQuery) => QueryContainer.MatchAll(matchAllQuery);
2619
}
2720
}
28-
29-
namespace Elastic.Clients.Elasticsearch
30-
{
31-
// Stubs until we generate these - Allows the code to compile so we can identify real errors.
32-
33-
public partial class HttpHeaders : Dictionary<string, Union<string, IReadOnlyCollection<string>>>
34-
{
35-
}
36-
37-
public partial class Metadata : Dictionary<string, object>
38-
{
39-
}
40-
41-
//public partial class RuntimeFields : Dictionary<Field, RuntimeField>
42-
//{
43-
//}
44-
45-
public partial class ApplicationsPrivileges : Dictionary<Name, ResourcePrivileges>
46-
{
47-
}
48-
49-
public partial class Privileges : Dictionary<string, bool>
50-
{
51-
}
52-
53-
public partial class ResourcePrivileges : Dictionary<Name, Privileges>
54-
{
55-
}
56-
57-
// TODO: Implement properly
58-
[JsonConverter(typeof(PercentageConverter))]
59-
public partial class Percentage
60-
{
61-
}
62-
}

src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregationContainer.g.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
namespace Elastic.Clients.Elasticsearch.Aggregations
2626
{
2727
[JsonConverter(typeof(AggregationContainerConverter))]
28-
public partial class AggregationContainer : IContainer
28+
public partial class AggregationContainer
2929
{
3030
public AggregationContainer(AggregationBase variant) => Variant = variant ?? throw new ArgumentNullException(nameof(variant));
3131
internal AggregationBase Variant { get; }

src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramAggregation.g.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,14 +300,12 @@ public override void Write(Utf8JsonWriter writer, DateHistogramAggregation value
300300
}
301301

302302
[JsonConverter(typeof(DateHistogramAggregationConverter))]
303-
public partial class DateHistogramAggregation : BucketAggregationBase, TransformManagement.IPivotGroupByContainerVariant
303+
public partial class DateHistogramAggregation : BucketAggregationBase, TransformManagement.IPivotGroupByVariant
304304
{
305305
public DateHistogramAggregation(string name) : base(name)
306306
{
307307
}
308308

309-
[JsonIgnore]
310-
string TransformManagement.IPivotGroupByContainerVariant.PivotGroupByContainerVariantName => "date_histogram";
311309
[JsonInclude]
312310
[JsonPropertyName("calendar_interval")]
313311
public Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval? CalendarInterval { get; set; }

src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramAggregation.g.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,14 +232,12 @@ public override void Write(Utf8JsonWriter writer, HistogramAggregation value, Js
232232
}
233233

234234
[JsonConverter(typeof(HistogramAggregationConverter))]
235-
public partial class HistogramAggregation : BucketAggregationBase, TransformManagement.IPivotGroupByContainerVariant
235+
public partial class HistogramAggregation : BucketAggregationBase, TransformManagement.IPivotGroupByVariant
236236
{
237237
public HistogramAggregation(string name) : base(name)
238238
{
239239
}
240240

241-
[JsonIgnore]
242-
string TransformManagement.IPivotGroupByContainerVariant.PivotGroupByContainerVariantName => "histogram";
243241
[JsonInclude]
244242
[JsonPropertyName("field")]
245243
public Elastic.Clients.Elasticsearch.Field? Field { get; set; }

0 commit comments

Comments
 (0)