Skip to main content

UnmarshalStructToPb

UnmarshalStructToPb unmarshals a proto struct into a proto message using jsonPb marshaler.

def UnmarshalStructToPb(
structObj: *structpb.Struct,
msg: proto.Message
) - > error

Unmarshals a proto struct into a proto message using jsonPb marshaler. This function is used to convert a structured data object into a protobuf message format.

Parameters

NameTypeDescription
structObj*structpb.StructThe proto struct object to be unmarshaled. This object contains the structured data that needs to be converted.
msgproto.MessageThe proto message object into which the data from structObj will be unmarshaled. This is the target protobuf message.

Returns

TypeDescription
errorReturns an error if the input structObj or msg is nil, or if marshaling/unmarshaling fails.