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() + }; +}