| 273 | } |
| 274 | |
| 275 | CelValue LegacyTrivialListValue(google::protobuf::Arena* absl_nonnull arena, |
| 276 | const Value& value) { |
| 277 | if (auto legacy_list_value = common_internal::AsLegacyListValue(value); |
| 278 | legacy_list_value) { |
| 279 | return CelValue::CreateList(legacy_list_value->cel_list()); |
| 280 | } |
| 281 | if (auto parsed_repeated_field_value = value.AsParsedRepeatedField(); |
| 282 | parsed_repeated_field_value) { |
| 283 | auto maybe_cloned = parsed_repeated_field_value->Clone(arena); |
| 284 | return CelValue::CreateList(google::protobuf::Arena::Create<FieldBackedListImpl>( |
| 285 | arena, &maybe_cloned.message(), maybe_cloned.field(), arena)); |
| 286 | } |
| 287 | if (auto parsed_json_list_value = value.AsParsedJsonList(); |
| 288 | parsed_json_list_value) { |
| 289 | auto maybe_cloned = parsed_json_list_value->Clone(arena); |
| 290 | return CelValue::CreateList(google::protobuf::Arena::Create<FieldBackedListImpl>( |
| 291 | arena, cel::to_address(maybe_cloned), |
| 292 | well_known_types::GetListValueReflectionOrDie( |
| 293 | maybe_cloned->GetDescriptor()) |
| 294 | .GetValuesDescriptor(), |
| 295 | arena)); |
| 296 | } |
| 297 | if (auto custom_list_value = value.AsCustomList(); custom_list_value) { |
| 298 | auto status_or_compat_list = common_internal::MakeCompatListValue( |
| 299 | *custom_list_value, google::protobuf::DescriptorPool::generated_pool(), |
| 300 | google::protobuf::MessageFactory::generated_factory(), arena); |
| 301 | if (!status_or_compat_list.ok()) { |
| 302 | return CelValue::CreateError(google::protobuf::Arena::Create<absl::Status>( |
| 303 | arena, std::move(status_or_compat_list).status())); |
| 304 | } |
| 305 | return CelValue::CreateList(*status_or_compat_list); |
| 306 | } |
| 307 | return CelValue::CreateError(google::protobuf::Arena::Create<absl::Status>( |
| 308 | arena, absl::InvalidArgumentError(absl::StrCat( |
| 309 | "unsupported conversion from cel::ListValue to CelValue: ", |
| 310 | value.GetRuntimeType().DebugString())))); |
| 311 | } |
| 312 | |
| 313 | CelValue LegacyTrivialMapValue(google::protobuf::Arena* absl_nonnull arena, |
| 314 | const Value& value) { |
no test coverage detected