| 858 | } |
| 859 | |
| 860 | google::protobuf::Message* TimestampFromValue(const google::protobuf::Message* prototype, |
| 861 | const CelValue& value, |
| 862 | google::protobuf::Arena* arena) { |
| 863 | absl::Time val; |
| 864 | if (!value.GetValue(&val)) { |
| 865 | return nullptr; |
| 866 | } |
| 867 | if (!cel::internal::ValidateTimestamp(val).ok()) { |
| 868 | return nullptr; |
| 869 | } |
| 870 | auto* message = prototype->New(arena); |
| 871 | CEL_ASSIGN_OR_RETURN( |
| 872 | auto reflection, |
| 873 | cel::well_known_types::GetTimestampReflection(message->GetDescriptor()), |
| 874 | _.With(IgnoreErrorAndReturnNullptr())); |
| 875 | reflection.UnsafeSetFromAbslTime(message, val); |
| 876 | return message; |
| 877 | } |
| 878 | |
| 879 | google::protobuf::Message* UInt32FromValue(const google::protobuf::Message* prototype, |
| 880 | const CelValue& value, google::protobuf::Arena* arena) { |
no test coverage detected