Vertex AI v1 API - Class ValueConverter (3.17.0)

public static class ValueConverter

Reference documentation and code samples for the Vertex AI v1 API class ValueConverter.

Utility methods for working with Value and Struct.

Inheritance

object > ValueConverter

Namespace

Google.Cloud.AIPlatform.V1

Assembly

Google.Cloud.AIPlatform.V1.dll

Methods

ToMessage<T>(Struct)

public static T ToMessage<T>(Struct structValue) where T : IMessage, new()

Converts a Struct value to the specified message type.

Parameter
Name Description
structValue Struct

The Struct to convert. Must not be null.

Returns
Type Description
T

The message representation of the Struct.

Type Parameter
Name Description
T

The message type to convert the struct to.

ToMessage<T>(Value)

public static T ToMessage<T>(Value structValue) where T : IMessage, new()

Converts a Value value, which must represent a Struct, to the specified message type.

Parameter
Name Description
structValue Value

The Struct to convert. Must not be null.

Returns
Type Description
T

The message representation of the Struct.

Type Parameter
Name Description
T

The message type to convert the struct to.

ToStruct(IMessage)

public static Struct ToStruct(IMessage message)

Converts a protobuf message to a Struct.

Parameter
Name Description
message IMessage

The message to convert. Must not be null.

Returns
Type Description
Struct

The Struct representation of the message.

ToValue(IMessage)

public static Value ToValue(IMessage message)

Converts a protobuf message to a Value.

Parameter
Name Description
message IMessage

The message to convert. Must not be null.

Returns
Type Description
Value

The Struct representation of the message.