diff --git a/Google.Api.Gax.Grpc/RoutingHeaderExtractor.cs b/Google.Api.Gax.Grpc/RoutingHeaderExtractor.cs index 35a95ec2..86353d08 100644 --- a/Google.Api.Gax.Grpc/RoutingHeaderExtractor.cs +++ b/Google.Api.Gax.Grpc/RoutingHeaderExtractor.cs @@ -8,7 +8,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Text.RegularExpressions; namespace Google.Api.Gax.Grpc @@ -59,6 +58,16 @@ private RoutingHeaderExtractor(List patternExtractors) .ToList(); } + /// + /// Returns a string representation of the given value, suitable for including in a routing header. + /// (This method does not perform URI encoding; it is expected that the result of this method will either be + /// used in , or as an argument to + /// .) + /// + /// The value to format. May be null. + /// The formatted value, or null if is null. + public static string FormatRoutingHeaderValue(object value) => ProtobufUtilities.FormatValueAsJsonPrimitive(value); + /// /// Returns a new instance with the same parameter extractors as this one, with an additional one specified as arguments. /// The extractions follow the "last successfully matched wins" rule for