django_socio_grpc.protobuf.json_format

Module Contents

Functions

message_to_dict

Converts a protobuf message to a dictionary. Uses the default google.protobuf.json_format.MessageToDict function. Adds None values for optional fields that are not set.

parse_dict

_ConvertScalarFieldValue

We patch the json_format module to support UUIDs in ParseDict. By default, having a UUID in a message will raise a TypeError.

Data

_BaseConvertScalarFieldValue

API

django_socio_grpc.protobuf.json_format.message_to_dict(message, **kwargs)

Converts a protobuf message to a dictionary. Uses the default google.protobuf.json_format.MessageToDict function. Adds None values for optional fields that are not set.

django_socio_grpc.protobuf.json_format.parse_dict(js_dict, message, **kwargs)
django_socio_grpc.protobuf.json_format._ConvertScalarFieldValue(value, *args, **kwargs)

We patch the json_format module to support UUIDs in ParseDict. By default, having a UUID in a message will raise a TypeError.

django_socio_grpc.protobuf.json_format._BaseConvertScalarFieldValue

None