| 1453 | } // namespace |
| 1454 | |
| 1455 | CelValue UnwrapMessageToValue(const google::protobuf::Message* value, |
| 1456 | const ProtobufValueFactory& factory, |
| 1457 | Arena* arena) { |
| 1458 | // Messages are Nullable types |
| 1459 | if (value == nullptr) { |
| 1460 | return CelValue::CreateNull(); |
| 1461 | } |
| 1462 | |
| 1463 | absl::optional<CelValue> special_value = |
| 1464 | ValueFromMessageMaker::CreateValue(value, factory, arena); |
| 1465 | if (special_value.has_value()) { |
| 1466 | return *special_value; |
| 1467 | } |
| 1468 | return factory(value); |
| 1469 | } |
| 1470 | |
| 1471 | const google::protobuf::Message* MaybeWrapValueToMessage( |
| 1472 | const google::protobuf::Descriptor* descriptor, google::protobuf::MessageFactory* factory, |