From f7c637e977bcaa59c05b494ab4e3023ea834b13e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 5 Sep 2024 11:22:04 +0200 Subject: [PATCH] Fix `SourceConfigParam` url parameter serialization (#8328) (#8331) Co-authored-by: Florian Bernd --- .../Types/Core/Search/SourceConfigParam.cs | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Search/SourceConfigParam.cs diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Search/SourceConfigParam.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Search/SourceConfigParam.cs new file mode 100644 index 00000000000..9a1fb940454 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Search/SourceConfigParam.cs @@ -0,0 +1,25 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +using System; + +using Elastic.Transport; + +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; +#else +namespace Elastic.Clients.Elasticsearch.Core.Search; +#endif + +public partial class SourceConfigParam : + IUrlParameter +{ + public string GetString(ITransportConfiguration settings) => + Tag switch + { + 0 => UrlFormatter.CreateString(Item1, settings)!, + 1 => UrlFormatter.CreateString(Item2, settings)!, + _ => throw new InvalidOperationException() + }; +}