| 79 | } |
| 80 | |
| 81 | absl::StatusOr<absl::optional<ErrorValue>> ProtoMessageCopy( |
| 82 | google::protobuf::Message* absl_nonnull to_message, |
| 83 | const google::protobuf::Descriptor* absl_nonnull to_descriptor, |
| 84 | const google::protobuf::Message* absl_nonnull from_message) { |
| 85 | CEL_ASSIGN_OR_RETURN(const auto* from_descriptor, |
| 86 | GetDescriptor(*from_message)); |
| 87 | if (to_descriptor == from_descriptor) { |
| 88 | // Same. |
| 89 | to_message->CopyFrom(*from_message); |
| 90 | return absl::nullopt; |
| 91 | } |
| 92 | if (to_descriptor->full_name() == from_descriptor->full_name()) { |
| 93 | // Same type, different descriptors. |
| 94 | return ProtoMessageCopyUsingSerialization(to_message, from_message); |
| 95 | } |
| 96 | return TypeConversionError(from_descriptor->full_name(), |
| 97 | to_descriptor->full_name()); |
| 98 | } |
| 99 | |
| 100 | absl::StatusOr<absl::optional<ErrorValue>> ProtoMessageFromValueImpl( |
| 101 | const Value& value, const google::protobuf::DescriptorPool* absl_nonnull pool, |
no test coverage detected