| 832 | |
| 833 | template <typename Map> |
| 834 | absl::Status MapValueToJson( |
| 835 | const Map& map, const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool, |
| 836 | google::protobuf::MessageFactory* absl_nonnull message_factory, |
| 837 | google::protobuf::Message* absl_nonnull json) { |
| 838 | ABSL_DCHECK(descriptor_pool != nullptr); |
| 839 | ABSL_DCHECK(message_factory != nullptr); |
| 840 | ABSL_DCHECK(json != nullptr); |
| 841 | ABSL_DCHECK_EQ(json->GetDescriptor()->well_known_type(), |
| 842 | google::protobuf::Descriptor::WELLKNOWNTYPE_VALUE); |
| 843 | |
| 844 | ValueReflection reflection; |
| 845 | CEL_RETURN_IF_ERROR(reflection.Initialize(json->GetDescriptor())); |
| 846 | return MapValueToJsonObject(map, descriptor_pool, message_factory, |
| 847 | reflection.MutableStructValue(json)); |
| 848 | } |
| 849 | |
| 850 | struct ValueHasher { |
| 851 | using is_transparent = void; |
nothing calls this directly
no test coverage detected