Functions

pack
I

Generate and return the generic 'any:Any record that is used to represent protobuf Any type.

unpack
I

Unpack and return the specified Ballerina value

pack

function pack(ValueType message) returns Any
Isolated Function

Generate and return the generic 'any:Any record that is used to represent protobuf Any type.

Parameters

  • message ValueType
  • The record or the scalar value to be packed as Any type

Return Type

(Any)

Any value representation of the given message

unpack

function unpack(Any anyValue, ValueTypeDesc targetTypeOfAny) returns targetTypeOfAny | Error
Isolated Function

Unpack and return the specified Ballerina value

Parameters

  • anyValue Any
  • Any value to be unpacked

  • targetTypeOfAny ValueTypeDesc (default <>)
  • Type descriptor of the return value

Return Type

(targetTypeOfAny | Error)

Return a value of the given type