| 192 | } |
| 193 | |
| 194 | absl::StatusOr<google::protobuf::Any> ToProtobufAny( |
| 195 | const StructValue& struct_value, |
| 196 | const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool, |
| 197 | google::protobuf::MessageFactory* absl_nonnull message_factory, |
| 198 | google::protobuf::Arena* absl_nonnull arena) { |
| 199 | google::protobuf::io::CordOutputStream serialized; |
| 200 | CEL_RETURN_IF_ERROR( |
| 201 | struct_value.SerializeTo(descriptor_pool, message_factory, &serialized)); |
| 202 | google::protobuf::Any result; |
| 203 | result.set_type_url(MakeTypeUrl(struct_value.GetTypeName())); |
| 204 | result.set_value(std::string(std::move(serialized).Consume())); |
| 205 | |
| 206 | return result; |
| 207 | } |
| 208 | |
| 209 | } // namespace |
| 210 |
no test coverage detected