|
def | _ConvertBool (value, require_str) |
|
def | _ConvertFloat (value) |
|
def | _ConvertFloat (value, field) |
|
def | _ConvertInteger (value) |
|
def | _ConvertScalarFieldValue (value, field, require_str=False) |
|
def | _CreateMessageFromTypeUrl (type_url, descriptor_pool) |
|
def | _DuplicateChecker (js) |
|
def | _IsMapEntry (field) |
|
def | _IsWrapperMessage (message_descriptor) |
|
def | MessageToDict (message, including_default_value_fields=False, preserving_proto_field_name=False, use_integers_for_enums=False, descriptor_pool=None) |
|
def | MessageToDict (message, including_default_value_fields=False, preserving_proto_field_name=False, use_integers_for_enums=False, descriptor_pool=None, float_precision=None) |
|
def | MessageToJson (message, including_default_value_fields=False, preserving_proto_field_name=False, indent=2, sort_keys=False, use_integers_for_enums=False, descriptor_pool=None) |
|
def | MessageToJson (message, including_default_value_fields=False, preserving_proto_field_name=False, indent=2, sort_keys=False, use_integers_for_enums=False, descriptor_pool=None, float_precision=None) |
|
def | Parse (text, message, ignore_unknown_fields=False, descriptor_pool=None) |
|
def | ParseDict (js_dict, message, ignore_unknown_fields=False, descriptor_pool=None) |
|
def google.protobuf.json_format.MessageToDict |
( |
|
message, |
|
|
|
including_default_value_fields = False , |
|
|
|
preserving_proto_field_name = False , |
|
|
|
use_integers_for_enums = False , |
|
|
|
descriptor_pool = None |
|
) |
| |
Converts protobuf message to a dictionary.
When the dictionary is encoded to JSON, it conforms to proto3 JSON spec.
Args:
message: The protocol buffers message instance to serialize.
including_default_value_fields: If True, singular primitive fields,
repeated fields, and map fields will always be serialized. If
False, only serialize non-empty fields. Singular message fields
and oneof fields are not affected by this option.
preserving_proto_field_name: If True, use the original proto field
names as defined in the .proto file. If False, convert the field
names to lowerCamelCase.
use_integers_for_enums: If true, print integers instead of enum names.
descriptor_pool: A Descriptor Pool for resolving types. If None use the
default.
Returns:
A dict representation of the protocol buffer message.
Definition at line 136 of file bloaty/third_party/protobuf/python/google/protobuf/json_format.py.
def google.protobuf.json_format.MessageToDict |
( |
|
message, |
|
|
|
including_default_value_fields = False , |
|
|
|
preserving_proto_field_name = False , |
|
|
|
use_integers_for_enums = False , |
|
|
|
descriptor_pool = None , |
|
|
|
float_precision = None |
|
) |
| |
Converts protobuf message to a dictionary.
When the dictionary is encoded to JSON, it conforms to proto3 JSON spec.
Args:
message: The protocol buffers message instance to serialize.
including_default_value_fields: If True, singular primitive fields,
repeated fields, and map fields will always be serialized. If
False, only serialize non-empty fields. Singular message fields
and oneof fields are not affected by this option.
preserving_proto_field_name: If True, use the original proto field
names as defined in the .proto file. If False, convert the field
names to lowerCamelCase.
use_integers_for_enums: If true, print integers instead of enum names.
descriptor_pool: A Descriptor Pool for resolving types. If None use the
default.
float_precision: If set, use this to specify float field valid digits.
Returns:
A dict representation of the protocol buffer message.
Definition at line 130 of file protobuf/python/google/protobuf/json_format.py.
def google.protobuf.json_format.MessageToJson |
( |
|
message, |
|
|
|
including_default_value_fields = False , |
|
|
|
preserving_proto_field_name = False , |
|
|
|
indent = 2 , |
|
|
|
sort_keys = False , |
|
|
|
use_integers_for_enums = False , |
|
|
|
descriptor_pool = None |
|
) |
| |
Converts protobuf message to JSON format.
Args:
message: The protocol buffers message instance to serialize.
including_default_value_fields: If True, singular primitive fields,
repeated fields, and map fields will always be serialized. If
False, only serialize non-empty fields. Singular message fields
and oneof fields are not affected by this option.
preserving_proto_field_name: If True, use the original proto field
names as defined in the .proto file. If False, convert the field
names to lowerCamelCase.
indent: The JSON object will be pretty-printed with this indent level.
An indent level of 0 or negative will only insert newlines.
sort_keys: If True, then the output will be sorted by field names.
use_integers_for_enums: If true, print integers instead of enum names.
descriptor_pool: A Descriptor Pool for resolving types. If None use the
default.
Returns:
A string containing the JSON formatted protocol buffer message.
Definition at line 99 of file bloaty/third_party/protobuf/python/google/protobuf/json_format.py.
def google.protobuf.json_format.MessageToJson |
( |
|
message, |
|
|
|
including_default_value_fields = False , |
|
|
|
preserving_proto_field_name = False , |
|
|
|
indent = 2 , |
|
|
|
sort_keys = False , |
|
|
|
use_integers_for_enums = False , |
|
|
|
descriptor_pool = None , |
|
|
|
float_precision = None |
|
) |
| |
Converts protobuf message to JSON format.
Args:
message: The protocol buffers message instance to serialize.
including_default_value_fields: If True, singular primitive fields,
repeated fields, and map fields will always be serialized. If
False, only serialize non-empty fields. Singular message fields
and oneof fields are not affected by this option.
preserving_proto_field_name: If True, use the original proto field
names as defined in the .proto file. If False, convert the field
names to lowerCamelCase.
indent: The JSON object will be pretty-printed with this indent level.
An indent level of 0 or negative will only insert newlines.
sort_keys: If True, then the output will be sorted by field names.
use_integers_for_enums: If true, print integers instead of enum names.
descriptor_pool: A Descriptor Pool for resolving types. If None use the
default.
float_precision: If set, use this to specify float field valid digits.
Returns:
A string containing the JSON formatted protocol buffer message.
Definition at line 90 of file protobuf/python/google/protobuf/json_format.py.