Skip to content

Commit 96b0e65

Browse files
committed
Fix Slices url parameter serialization
1 parent dee9c1b commit 96b0e65

File tree

1 file changed

+22
-0
lines changed
  • src/Elastic.Clients.Elasticsearch.Shared/Types

1 file changed

+22
-0
lines changed
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System;
2+
using System.Globalization;
3+
4+
using Elastic.Transport;
5+
6+
#if ELASTICSEARCH_SERVERLESS
7+
namespace Elastic.Clients.Elasticsearch.Serverless;
8+
#else
9+
namespace Elastic.Clients.Elasticsearch;
10+
#endif
11+
12+
public partial class Slices :
13+
IUrlParameter
14+
{
15+
public string GetString(ITransportConfiguration settings) =>
16+
Tag switch
17+
{
18+
0 => Item1.ToString(CultureInfo.InvariantCulture),
19+
1 => UrlFormatter.CreateString(Item2, settings)!,
20+
_ => throw new InvalidOperationException()
21+
};
22+
}

0 commit comments

Comments
 (0)