Class ValueConverter (2.2.0)

public static 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
NameDescription
structValueStruct

The Struct to convert. Must not be null.

Returns
TypeDescription
T

The message representation of the Struct.

Type Parameter
NameDescription
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
NameDescription
structValueValue

The Struct to convert. Must not be null.

Returns
TypeDescription
T

The message representation of the Struct.

Type Parameter
NameDescription
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
NameDescription
messageIMessage

The message to convert. Must not be null.

Returns
TypeDescription
Struct

The Struct representation of the message.

ToValue(IMessage)

public static Value ToValue(IMessage message)

Converts a protobuf message to a Value.

Parameter
NameDescription
messageIMessage

The message to convert. Must not be null.

Returns
TypeDescription
Value

The Struct representation of the message.