Skip to content

Commit

Permalink
Fix Slices url parameter serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
flobernd committed Sep 4, 2024
1 parent dee9c1b commit 96b0e65
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/Elastic.Clients.Elasticsearch.Shared/Types/Slices.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using System.Globalization;

using Elastic.Transport;

#if ELASTICSEARCH_SERVERLESS
namespace Elastic.Clients.Elasticsearch.Serverless;
#else
namespace Elastic.Clients.Elasticsearch;
#endif

public partial class Slices :
IUrlParameter
{
public string GetString(ITransportConfiguration settings) =>
Tag switch
{
0 => Item1.ToString(CultureInfo.InvariantCulture),
1 => UrlFormatter.CreateString(Item2, settings)!,
_ => throw new InvalidOperationException()
};
}

0 comments on commit 96b0e65

Please sign in to comment.