How to fill StringValue in protobuf (programming in python)
message event {
string id = 1;
google.protobuf.StringValue test = 2;
}
event.test.value = 'test'
Also works. It is more straightforward and doesn't require importing StringValue class.
After fighting for a while found the answer
event.test.CopyFrom(wrappers.StringValue(value='test'))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With