Skip to content

decode_public_protobuf

Part of Reusable workflows in the Python API reference.

Related guidance: shipped-tooling.

Runnable examples: decode_public_protobuf.py.

from picogrid_ecn_client.workflows import decode_public_protobuf

Decode one public entity-event protobuf payload without a connection.

def decode_public_protobuf(
payload: bytes,
*,
integration: str,
category: EntityCategory,
maximum_payload_size: int = 1024 * 1024,
) -> DecodePublicProtobufResult
NameTypeDefaultDescription
payloadbytesSerialized public entity-event protobuf bytes.
integrationstrIntegration name carried by the source topic.
categoryEntityCategoryEntity category carried by the source topic.
maximum_payload_sizeint1024 * 1024Largest payload accepted, in bytes.
TypeDescription
DecodePublicProtobufResultThe validated public entity event.
ExceptionDescription
ProtocolErrorIf the payload is malformed or disagrees with its category.
ResourceLimitErrorIf payload exceeds maximum_payload_size.
ValidationErrorIf an input or decoded public field is invalid.

Source · workflows/protobuf.py

Version 0.2.0 · branch main