Skip to content

Commit fe64615

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

File tree

1 file changed

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

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System;
2+
using System.Globalization;
3+
4+
#if ELASTICSEARCH_SERVERLESS
5+
namespace Elastic.Clients.Elasticsearch.Serverless;
6+
#else
7+
namespace Elastic.Clients.Elasticsearch;
8+
#endif
9+
10+
using Elastic.Transport;
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)