Content-Length: 305309 | pFad | https://github.com/googleapis/google-cloud-dotnet/commit/50afb69

B6 Explicitly use Google.Protobuf.WellKnownTypes.Value in ValueConverter · googleapis/google-cloud-dotnet@50afb69 · GitHub
Skip to content

Commit 50afb69

Browse files
committed
Explicitly use Google.Protobuf.WellKnownTypes.Value in ValueConverter
This will fix the post-generation build problem described in #6743. (We'll need to rerun autosynth to clear it.)
1 parent 95ad6fa commit 50afb69

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

apis/Google.Cloud.AIPlatform.V1/Google.Cloud.AIPlatform.V1/ValueConverter.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using Google.Api.Gax;
1616
using Google.Protobuf;
1717
using Google.Protobuf.WellKnownTypes;
18+
using WktValue = Google.Protobuf.WellKnownTypes.Value;
1819

1920
namespace Google.Cloud.AIPlatform.V1
2021
{
@@ -40,7 +41,7 @@ public static Struct ToStruct(IMessage message)
4041
//github.com/ </summary>
4142
//github.com/ <param name="message">The message to convert. Must not be null.</param>
4243
//github.com/ <returns>The Struct representation of the message.</returns>
43-
public static Value ToValue(IMessage message) => Value.ForStruct(ToStruct(message));
44+
public static WktValue ToValue(IMessage message) => WktValue.ForStruct(ToStruct(message));
4445

4546
//github.com/ <summary>
4647
//github.com/ Converts a <see cref="Struct"/> value to the specified message type.
@@ -61,10 +62,10 @@ public static Struct ToStruct(IMessage message)
6162
//github.com/ <typeparam name="T">The message type to convert the struct to.</typeparam>
6263
//github.com/ <param name="structValue">The Struct to convert. Must not be null.</param>
6364
//github.com/ <returns>The message representation of the Struct.</returns>
64-
public static T ToMessage<T>(Value structValue) where T : IMessage, new()
65+
public static T ToMessage<T>(WktValue structValue) where T : IMessage, new()
6566
{
6667
GaxPreconditions.CheckNotNull(structValue, nameof(structValue));
67-
GaxPreconditions.CheckArgument(structValue.KindCase == Value.KindOneofCase.StructValue,
68+
GaxPreconditions.CheckArgument(structValue.KindCase == WktValue.KindOneofCase.StructValue,
6869
nameof(structValue),
6970
"The value being converted must represent a Struct");
7071
return ToMessage<T>(structValue.StructValue);

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/googleapis/google-cloud-dotnet/commit/50afb69

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy