| 843 | } |
| 844 | |
| 845 | google::protobuf::Message* StringFromValue(const google::protobuf::Message* prototype, |
| 846 | const CelValue& value, google::protobuf::Arena* arena) { |
| 847 | CelValue::StringHolder view_val; |
| 848 | if (!value.GetValue(&view_val)) { |
| 849 | return nullptr; |
| 850 | } |
| 851 | auto* message = prototype->New(arena); |
| 852 | CEL_ASSIGN_OR_RETURN( |
| 853 | auto reflection, |
| 854 | cel::well_known_types::GetStringValueReflection(message->GetDescriptor()), |
| 855 | _.With(IgnoreErrorAndReturnNullptr())); |
| 856 | reflection.SetValue(message, view_val.value()); |
| 857 | return message; |
| 858 | } |
| 859 | |
| 860 | google::protobuf::Message* TimestampFromValue(const google::protobuf::Message* prototype, |
| 861 | const CelValue& value, |
no test coverage detected