Skip to content

Commit 5d9a164

Browse files
authored
Support descriptors for internally-tagged unions (#6414)
* Initial work on internally-tagged union descriptors * Update SDK * Update code gen * Skip descriptors on abstract types * Further work on internally tagged unions * No more synthetic names * Implementing IBuildableDescriptor * Generate descriptors for internally tagged unions containers * Fixed variant types and initial descriptor properties * Additional tagged union descriptor properties * Name fixes and more descriptor method overloads * Add scalar overloads * Generating descriptor properties for tagged unions * Add tagged union descriptor assignment methods * Added generic client methods if descriptor supports generics * Fix BOM on files
1 parent 5152683 commit 5d9a164

File tree

372 files changed

+40001
-3555
lines changed

Some content is hidden

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

372 files changed

+40001
-3555
lines changed

.ci/DockerFile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG DOTNET_VERSION=6.0.202
1+
ARG DOTNET_VERSION=6.0.300
22
FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION} AS elasticsearch-net-build
33

44
ARG USER_ID

.ci/make.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ OUTPUT_DIR="$repo/${output_folder}"
4242
REPO_BINDING="${OUTPUT_DIR}:/sln/${output_folder}"
4343
mkdir -p "$OUTPUT_DIR"
4444

45-
DOTNET_VERSION=${DOTNET_VERSION-6.0.202}
45+
DOTNET_VERSION=${DOTNET_VERSION-6.0.300}
4646

4747
echo -e "\033[34;1mINFO:\033[0m PRODUCT ${product}\033[0m"
4848
echo -e "\033[34;1mINFO:\033[0m VERSION ${STACK_VERSION}\033[0m"

.ci/readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ $ STACK_VERSION=8.0.0-SNAPSHOT ./.ci/run-tests
3030
|-------------------------|-------------|-------------|
3131
| `STACK_VERSION` | `N/A` | The elasticsearch version to target
3232
| `TEST_SUITE` | `basic` | `free` or `platinum` sets which test suite to run and which container to run against. |
33-
| `DOTNET_VERSION` | `6.0.202` | The .NET sdk version used to grab the proper container |
33+
| `DOTNET_VERSION` | `6.0.300` | The .NET sdk version used to grab the proper container |
3434

3535
If you want to manually spin up elasticsearch for these tests and call the runner afterwards you can use
3636

.ci/run-repository.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ param(
1414
$NODE_NAME,
1515

1616
[string]
17-
$DOTNET_VERSION = "6.0.202"
17+
$DOTNET_VERSION = "6.0.300"
1818
)
1919

2020
$ESC = [char]27

.ci/run-repository.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ script_path=$(dirname $(realpath -s $0))
99
source $script_path/functions/imports.sh
1010
set -euo pipefail
1111

12-
DOTNET_VERSION=${DOTNET_VERSION-6.0.202}
12+
DOTNET_VERSION=${DOTNET_VERSION-6.0.300}
1313
ELASTICSEARCH_URL=${ELASTICSEARCH_URL-"$elasticsearch_url"}
1414
elasticsearch_container=${elasticsearch_container-}
1515

.ci/run-tests.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ param (
88
$TEST_SUITE = "free",
99

1010
[string]
11-
$DOTNET_VERSION = "6.0.202"
11+
$DOTNET_VERSION = "6.0.300"
1212
)
1313

1414
$ESC = [char]27

.ci/test-matrix.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ TEST_SUITE:
88
- platinum
99

1010
DOTNET_VERSION:
11-
- 6.0.202
11+
- 6.0.300
1212

1313
exclude: ~

.github/workflows/integration-jobs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
uses: actions/checkout@v2
3131
- uses: actions/setup-dotnet@v1
3232
with:
33-
dotnet-version: '6.0.202'
33+
dotnet-version: '6.0.300'
3434
- uses: actions/cache@v2
3535
with:
3636
path: ~/.nuget/packages

.github/workflows/make-bump.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
# Add version and backport labels automatically
3636
- uses: actions/setup-dotnet@v1
3737
with:
38-
dotnet-version: '6.0.202'
38+
dotnet-version: '6.0.300'
3939
- name: Install dotnet-script
4040
run: dotnet tool install release-notes --tool-path dotnet-tool
4141

.github/workflows/make-release-notes.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151

5252
- uses: actions/setup-dotnet@v1
5353
with:
54-
dotnet-version: '6.0.202'
54+
dotnet-version: '6.0.300'
5555
- name: Install dotnet-script
5656
run: dotnet tool install release-notes --tool-path dotnet-tool
5757

.github/workflows/stale-jobs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
uses: actions/checkout@v2
2525
- uses: actions/setup-dotnet@v1
2626
with:
27-
dotnet-version: '6.0.202'
27+
dotnet-version: '6.0.300'
2828
- uses: actions/cache@v2
2929
with:
3030
path: ~/.nuget/packages

.github/workflows/test-jobs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
uses: actions/checkout@v2
2424
- uses: actions/setup-dotnet@v1
2525
with:
26-
dotnet-version: '6.0.202'
26+
dotnet-version: '6.0.300'
2727
- uses: actions/cache@v2
2828
with:
2929
path: ~/.nuget/packages
@@ -53,7 +53,7 @@ jobs:
5353
uses: actions/checkout@v2
5454
- uses: actions/setup-dotnet@v1
5555
with:
56-
dotnet-version: '6.0.202'
56+
dotnet-version: '6.0.300'
5757
- uses: actions/cache@v2
5858
with:
5959
path: ~/.nuget/packages

.github/workflows/unified-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
uses: actions/checkout@v2
2929
- uses: actions/setup-dotnet@v1
3030
with:
31-
dotnet-version: '6.0.202'
31+
dotnet-version: '6.0.300'
3232

3333
- run: "./.ci/make.sh assemble ${{ matrix.stack_version }}"
3434
name: Assemble ${{ matrix.stack_version }}

benchmarks/Benchmarks/packages.lock.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@
2929
"type": "Direct",
3030
"requested": "[1.0.2, )",
3131
"resolved": "1.0.2",
32-
"contentHash": "5/cSEVld+px/CuRrbohO/djfg6++eR6zGpy88MgqloXvkj//WXWpFZyu/OpkXPN0u5m+dN/EVwLNYFUxD4h2+A=="
32+
"contentHash": "5/cSEVld+px/CuRrbohO/djfg6++eR6zGpy88MgqloXvkj//WXWpFZyu/OpkXPN0u5m+dN/EVwLNYFUxD4h2+A==",
33+
"dependencies": {
34+
"Microsoft.NETFramework.ReferenceAssemblies.net461": "1.0.2"
35+
}
3336
},
3437
"NEST": {
3538
"type": "Direct",
@@ -184,6 +187,11 @@
184187
"resolved": "1.1.0",
185188
"contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg=="
186189
},
190+
"Microsoft.NETFramework.ReferenceAssemblies.net461": {
191+
"type": "Transitive",
192+
"resolved": "1.0.2",
193+
"contentHash": "8shzGaD5pZi4npuJYCM3de6pl0zlefcbyTIvXIiCdsTqauZ7lAhdaJVtJSqlhYid9VosFAOygBykoJ1SEOlGWA=="
194+
},
187195
"Microsoft.Win32.Registry": {
188196
"type": "Transitive",
189197
"resolved": "4.5.0",

benchmarks/Profiling/packages.lock.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
"type": "Direct",
1313
"requested": "[1.0.2, )",
1414
"resolved": "1.0.2",
15-
"contentHash": "5/cSEVld+px/CuRrbohO/djfg6++eR6zGpy88MgqloXvkj//WXWpFZyu/OpkXPN0u5m+dN/EVwLNYFUxD4h2+A=="
15+
"contentHash": "5/cSEVld+px/CuRrbohO/djfg6++eR6zGpy88MgqloXvkj//WXWpFZyu/OpkXPN0u5m+dN/EVwLNYFUxD4h2+A==",
16+
"dependencies": {
17+
"Microsoft.NETFramework.ReferenceAssemblies.net461": "1.0.2"
18+
}
1619
},
1720
"Elastic.Transport": {
1821
"type": "Transitive",
@@ -30,6 +33,11 @@
3033
"resolved": "4.7.0",
3134
"contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA=="
3235
},
36+
"Microsoft.NETFramework.ReferenceAssemblies.net461": {
37+
"type": "Transitive",
38+
"resolved": "1.0.2",
39+
"contentHash": "8shzGaD5pZi4npuJYCM3de6pl0zlefcbyTIvXIiCdsTqauZ7lAhdaJVtJSqlhYid9VosFAOygBykoJ1SEOlGWA=="
40+
},
3341
"System.Buffers": {
3442
"type": "Transitive",
3543
"resolved": "4.5.1",

build/scripts/packages.lock.json

+12-4
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,18 @@
8080
},
8181
"FSharp.Core": {
8282
"type": "Direct",
83-
"requested": "[6.0.2, )",
84-
"resolved": "6.0.2",
85-
"contentHash": "8GZqv6buY71KQlWT+cl2eMi+aNX9xQ61RgI3Pzv9zPxPOX6tWCLRrBj0MYQ3h871r2RhiHUl7f0AXUD/POr8eA=="
83+
"requested": "[6.0.4, )",
84+
"resolved": "6.0.4",
85+
"contentHash": "CYqAfmO7JvN38M+ACkstS8taVfl8C0mCkvSiBAshfKuu2Nut6+8MuFU7Wahu09wGIyFPlRz5ArFWxSOM5mhMSA=="
8686
},
8787
"Microsoft.NETFramework.ReferenceAssemblies": {
8888
"type": "Direct",
8989
"requested": "[1.0.2, )",
9090
"resolved": "1.0.2",
91-
"contentHash": "5/cSEVld+px/CuRrbohO/djfg6++eR6zGpy88MgqloXvkj//WXWpFZyu/OpkXPN0u5m+dN/EVwLNYFUxD4h2+A=="
91+
"contentHash": "5/cSEVld+px/CuRrbohO/djfg6++eR6zGpy88MgqloXvkj//WXWpFZyu/OpkXPN0u5m+dN/EVwLNYFUxD4h2+A==",
92+
"dependencies": {
93+
"Microsoft.NETFramework.ReferenceAssemblies.net461": "1.0.2"
94+
}
9295
},
9396
"Newtonsoft.Json": {
9497
"type": "Direct",
@@ -183,6 +186,11 @@
183186
"resolved": "1.1.0",
184187
"contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg=="
185188
},
189+
"Microsoft.NETFramework.ReferenceAssemblies.net461": {
190+
"type": "Transitive",
191+
"resolved": "1.0.2",
192+
"contentHash": "8shzGaD5pZi4npuJYCM3de6pl0zlefcbyTIvXIiCdsTqauZ7lAhdaJVtJSqlhYid9VosFAOygBykoJ1SEOlGWA=="
193+
},
186194
"Microsoft.Win32.Primitives": {
187195
"type": "Transitive",
188196
"resolved": "4.3.0",

global.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"sdk": {
3-
"version": "6.0.202",
4-
"rollForward": "latestPatch",
3+
"version": "6.0.300",
4+
"rollForward": "minor",
55
"allowPrerelease": false
66
},
77
"version": "9.0.0-alpha.1",

src/Elastic.Clients.Elasticsearch.JsonNetSerializer/packages.lock.json

+45-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
"type": "Direct",
1313
"requested": "[1.0.2, )",
1414
"resolved": "1.0.2",
15-
"contentHash": "5/cSEVld+px/CuRrbohO/djfg6++eR6zGpy88MgqloXvkj//WXWpFZyu/OpkXPN0u5m+dN/EVwLNYFUxD4h2+A=="
15+
"contentHash": "5/cSEVld+px/CuRrbohO/djfg6++eR6zGpy88MgqloXvkj//WXWpFZyu/OpkXPN0u5m+dN/EVwLNYFUxD4h2+A==",
16+
"dependencies": {
17+
"Microsoft.NETFramework.ReferenceAssemblies.net461": "1.0.2"
18+
}
1619
},
1720
"Microsoft.SourceLink.GitHub": {
1821
"type": "Direct",
@@ -52,6 +55,11 @@
5255
"resolved": "4.7.0",
5356
"contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA=="
5457
},
58+
"Microsoft.NETFramework.ReferenceAssemblies.net461": {
59+
"type": "Transitive",
60+
"resolved": "1.0.2",
61+
"contentHash": "8shzGaD5pZi4npuJYCM3de6pl0zlefcbyTIvXIiCdsTqauZ7lAhdaJVtJSqlhYid9VosFAOygBykoJ1SEOlGWA=="
62+
},
5563
"Microsoft.SourceLink.Common": {
5664
"type": "Transitive",
5765
"resolved": "1.0.0",
@@ -263,7 +271,10 @@
263271
"type": "Direct",
264272
"requested": "[1.0.2, )",
265273
"resolved": "1.0.2",
266-
"contentHash": "5/cSEVld+px/CuRrbohO/djfg6++eR6zGpy88MgqloXvkj//WXWpFZyu/OpkXPN0u5m+dN/EVwLNYFUxD4h2+A=="
274+
"contentHash": "5/cSEVld+px/CuRrbohO/djfg6++eR6zGpy88MgqloXvkj//WXWpFZyu/OpkXPN0u5m+dN/EVwLNYFUxD4h2+A==",
275+
"dependencies": {
276+
"Microsoft.NETFramework.ReferenceAssemblies.net461": "1.0.2"
277+
}
267278
},
268279
"Microsoft.SourceLink.GitHub": {
269280
"type": "Direct",
@@ -330,6 +341,11 @@
330341
"resolved": "1.1.0",
331342
"contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg=="
332343
},
344+
"Microsoft.NETFramework.ReferenceAssemblies.net461": {
345+
"type": "Transitive",
346+
"resolved": "1.0.2",
347+
"contentHash": "8shzGaD5pZi4npuJYCM3de6pl0zlefcbyTIvXIiCdsTqauZ7lAhdaJVtJSqlhYid9VosFAOygBykoJ1SEOlGWA=="
348+
},
333349
"Microsoft.SourceLink.Common": {
334350
"type": "Transitive",
335351
"resolved": "1.0.0",
@@ -517,7 +533,10 @@
517533
"type": "Direct",
518534
"requested": "[1.0.2, )",
519535
"resolved": "1.0.2",
520-
"contentHash": "5/cSEVld+px/CuRrbohO/djfg6++eR6zGpy88MgqloXvkj//WXWpFZyu/OpkXPN0u5m+dN/EVwLNYFUxD4h2+A=="
536+
"contentHash": "5/cSEVld+px/CuRrbohO/djfg6++eR6zGpy88MgqloXvkj//WXWpFZyu/OpkXPN0u5m+dN/EVwLNYFUxD4h2+A==",
537+
"dependencies": {
538+
"Microsoft.NETFramework.ReferenceAssemblies.net461": "1.0.2"
539+
}
521540
},
522541
"Microsoft.SourceLink.GitHub": {
523542
"type": "Direct",
@@ -562,6 +581,11 @@
562581
"resolved": "4.7.0",
563582
"contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA=="
564583
},
584+
"Microsoft.NETFramework.ReferenceAssemblies.net461": {
585+
"type": "Transitive",
586+
"resolved": "1.0.2",
587+
"contentHash": "8shzGaD5pZi4npuJYCM3de6pl0zlefcbyTIvXIiCdsTqauZ7lAhdaJVtJSqlhYid9VosFAOygBykoJ1SEOlGWA=="
588+
},
565589
"Microsoft.SourceLink.Common": {
566590
"type": "Transitive",
567591
"resolved": "1.0.0",
@@ -651,7 +675,10 @@
651675
"type": "Direct",
652676
"requested": "[1.0.2, )",
653677
"resolved": "1.0.2",
654-
"contentHash": "5/cSEVld+px/CuRrbohO/djfg6++eR6zGpy88MgqloXvkj//WXWpFZyu/OpkXPN0u5m+dN/EVwLNYFUxD4h2+A=="
678+
"contentHash": "5/cSEVld+px/CuRrbohO/djfg6++eR6zGpy88MgqloXvkj//WXWpFZyu/OpkXPN0u5m+dN/EVwLNYFUxD4h2+A==",
679+
"dependencies": {
680+
"Microsoft.NETFramework.ReferenceAssemblies.net461": "1.0.2"
681+
}
655682
},
656683
"Microsoft.SourceLink.GitHub": {
657684
"type": "Direct",
@@ -690,6 +717,11 @@
690717
"resolved": "4.7.0",
691718
"contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA=="
692719
},
720+
"Microsoft.NETFramework.ReferenceAssemblies.net461": {
721+
"type": "Transitive",
722+
"resolved": "1.0.2",
723+
"contentHash": "8shzGaD5pZi4npuJYCM3de6pl0zlefcbyTIvXIiCdsTqauZ7lAhdaJVtJSqlhYid9VosFAOygBykoJ1SEOlGWA=="
724+
},
693725
"Microsoft.SourceLink.Common": {
694726
"type": "Transitive",
695727
"resolved": "1.0.0",
@@ -745,7 +777,10 @@
745777
"type": "Direct",
746778
"requested": "[1.0.2, )",
747779
"resolved": "1.0.2",
748-
"contentHash": "5/cSEVld+px/CuRrbohO/djfg6++eR6zGpy88MgqloXvkj//WXWpFZyu/OpkXPN0u5m+dN/EVwLNYFUxD4h2+A=="
780+
"contentHash": "5/cSEVld+px/CuRrbohO/djfg6++eR6zGpy88MgqloXvkj//WXWpFZyu/OpkXPN0u5m+dN/EVwLNYFUxD4h2+A==",
781+
"dependencies": {
782+
"Microsoft.NETFramework.ReferenceAssemblies.net461": "1.0.2"
783+
}
749784
},
750785
"Microsoft.SourceLink.GitHub": {
751786
"type": "Direct",
@@ -784,6 +819,11 @@
784819
"resolved": "4.7.0",
785820
"contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA=="
786821
},
822+
"Microsoft.NETFramework.ReferenceAssemblies.net461": {
823+
"type": "Transitive",
824+
"resolved": "1.0.2",
825+
"contentHash": "8shzGaD5pZi4npuJYCM3de6pl0zlefcbyTIvXIiCdsTqauZ7lAhdaJVtJSqlhYid9VosFAOygBykoJ1SEOlGWA=="
826+
},
787827
"Microsoft.SourceLink.Common": {
788828
"type": "Transitive",
789829
"resolved": "1.0.0",

src/Elastic.Clients.Elasticsearch/Common/Fluent/DescriptorBase.cs

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ namespace Elastic.Clients.Elasticsearch;
1313

1414
public abstract class Descriptor
1515
{
16+
// This internal ctor ensures that only types defined within the client assembly can derive from this base class.
17+
// We don't expect consumers to derive from this public base class.
1618
internal Descriptor() { }
1719

1820
/// <summary>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Licensed to Elasticsearch B.V under one or more agreements.
2+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
// See the LICENSE file in the project root for more information.
4+
5+
namespace Elastic.Clients.Elasticsearch;
6+
7+
/// <summary>
8+
/// Used to mark descriptors which can be used to build the object they describe.
9+
/// </summary>
10+
/// <remarks>
11+
/// This is most useful for descriptors of variants for internally-tagged unions where an IsADictionary is used
12+
/// </remarks>
13+
/// <typeparam name="T"></typeparam>
14+
internal interface IBuildableDescriptor<T>
15+
{
16+
T Build();
17+
}

0 commit comments

Comments
 (0)