| 919 | } |
| 920 | |
| 921 | google::protobuf::Message* ListFromValue(google::protobuf::Message* message, const CelValue& value, |
| 922 | google::protobuf::Arena* arena) { |
| 923 | if (!value.IsList()) { |
| 924 | return nullptr; |
| 925 | } |
| 926 | const CelList& list = *value.ListOrDie(); |
| 927 | CEL_ASSIGN_OR_RETURN( |
| 928 | auto reflection, |
| 929 | cel::well_known_types::GetListValueReflection(message->GetDescriptor()), |
| 930 | _.With(IgnoreErrorAndReturnNullptr())); |
| 931 | for (int i = 0; i < list.size(); i++) { |
| 932 | auto e = list.Get(arena, i); |
| 933 | auto* elem = reflection.AddValues(message); |
| 934 | if (ValueFromValue(elem, e, arena) == nullptr) { |
| 935 | return nullptr; |
| 936 | } |
| 937 | } |
| 938 | return message; |
| 939 | } |
| 940 | |
| 941 | google::protobuf::Message* ListFromValue(const google::protobuf::Message* prototype, |
| 942 | const CelValue& value, google::protobuf::Arena* arena) { |