Skip to main content

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 (structpb.Struct) into a specific Protocol Buffer message type.

Parameters

NameTypeDescription
structObj*structpb.StructThe source Protocol Buffer Struct object containing the data to be unmarshaled. This object should represent the data in a generic structured format.
msgproto.MessageThe target Protocol Buffer message into which the data from structObj will be unmarshaled. This must be a pointer to a proto.Message type.

Returns

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