| 723 | } |
| 724 | |
| 725 | google::protobuf::Message* DurationFromValue(const google::protobuf::Message* prototype, |
| 726 | const CelValue& value, |
| 727 | google::protobuf::Arena* arena) { |
| 728 | absl::Duration val; |
| 729 | if (!value.GetValue(&val)) { |
| 730 | return nullptr; |
| 731 | } |
| 732 | if (!cel::internal::ValidateDuration(val).ok()) { |
| 733 | return nullptr; |
| 734 | } |
| 735 | auto* message = prototype->New(arena); |
| 736 | CEL_ASSIGN_OR_RETURN( |
| 737 | auto reflection, |
| 738 | cel::well_known_types::GetDurationReflection(message->GetDescriptor()), |
| 739 | _.With(IgnoreErrorAndReturnNullptr())); |
| 740 | reflection.UnsafeSetFromAbslDuration(message, val); |
| 741 | return message; |
| 742 | } |
| 743 | |
| 744 | google::protobuf::Message* BoolFromValue(const google::protobuf::Message* prototype, |
| 745 | const CelValue& value, google::protobuf::Arena* arena) { |
no test coverage detected