Skip to content

Commit 6a4f108

Browse files
authored
Fix Slices url parameter serialization (#8327)
1 parent dee9c1b commit 6a4f108

File tree

1 file changed

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

1 file changed

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

0 commit comments

Comments
 (0)