See `ValueInterface::SerializeTo`.
| 400 | |
| 401 | // See `ValueInterface::SerializeTo`. |
| 402 | absl::Status LegacyListValue::SerializeTo( |
| 403 | const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool, |
| 404 | google::protobuf::MessageFactory* absl_nonnull message_factory, |
| 405 | google::protobuf::io::ZeroCopyOutputStream* absl_nonnull output) const { |
| 406 | ABSL_DCHECK(descriptor_pool != nullptr); |
| 407 | ABSL_DCHECK(message_factory != nullptr); |
| 408 | ABSL_DCHECK(output != nullptr); |
| 409 | |
| 410 | const google::protobuf::Descriptor* descriptor = |
| 411 | descriptor_pool->FindMessageTypeByName("google.protobuf.ListValue"); |
| 412 | if (descriptor == nullptr) { |
| 413 | return absl::InternalError( |
| 414 | "unable to locate descriptor for message type: " |
| 415 | "google.protobuf.ListValue"); |
| 416 | } |
| 417 | |
| 418 | google::protobuf::Arena arena; |
| 419 | const google::protobuf::Message* wrapped = MaybeWrapValueToMessage( |
| 420 | descriptor, message_factory, CelValue::CreateList(impl_), &arena); |
| 421 | if (wrapped == nullptr) { |
| 422 | return absl::UnknownError("failed to convert legacy map to JSON"); |
| 423 | } |
| 424 | if (!wrapped->SerializePartialToZeroCopyStream(output)) { |
| 425 | return absl::UnknownError( |
| 426 | absl::StrCat("failed to serialize message: ", wrapped->GetTypeName())); |
| 427 | } |
| 428 | return absl::OkStatus(); |
| 429 | } |
| 430 | |
| 431 | absl::Status LegacyListValue::ConvertToJson( |
| 432 | const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool, |
nothing calls this directly
no test coverage detected