15
15
using Google . Api . Gax ;
16
16
using Google . Protobuf ;
17
17
using Google . Protobuf . WellKnownTypes ;
18
+ using WktValue = Google . Protobuf . WellKnownTypes . Value ;
18
19
19
20
namespace Google . Cloud . AIPlatform . V1
20
21
{
@@ -40,7 +41,7 @@ public static Struct ToStruct(IMessage message)
40
41
//github.com/ </summary>
41
42
//github.com/ <param name="message">The message to convert. Must not be null.</param>
42
43
//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 ) ) ;
44
45
45
46
//github.com/ <summary>
46
47
//github.com/ Converts a <see cref="Struct"/> value to the specified message type.
@@ -61,10 +62,10 @@ public static Struct ToStruct(IMessage message)
61
62
//github.com/ <typeparam name="T">The message type to convert the struct to.</typeparam>
62
63
//github.com/ <param name="structValue">The Struct to convert. Must not be null.</param>
63
64
//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 ( )
65
66
{
66
67
GaxPreconditions . CheckNotNull ( structValue , nameof ( structValue ) ) ;
67
- GaxPreconditions . CheckArgument ( structValue . KindCase == Value . KindOneofCase . StructValue ,
68
+ GaxPreconditions . CheckArgument ( structValue . KindCase == WktValue . KindOneofCase . StructValue ,
68
69
nameof ( structValue ) ,
69
70
"The value being converted must represent a Struct" ) ;
70
71
return ToMessage < T > ( structValue . StructValue ) ;
0 commit comments