| 43 | } |
| 44 | |
| 45 | absl::StatusOr<Value> GetFieldValue( |
| 46 | const google::protobuf::FieldDescriptor* field_desc, const StructValue& struct_value, |
| 47 | const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool, |
| 48 | google::protobuf::MessageFactory* absl_nonnull message_factory, |
| 49 | google::protobuf::Arena* absl_nonnull arena) { |
| 50 | // Special case unset any. |
| 51 | if (field_desc->cpp_type() == google::protobuf::FieldDescriptor::CPPTYPE_MESSAGE && |
| 52 | field_desc->message_type()->well_known_type() == |
| 53 | Descriptor::WELLKNOWNTYPE_ANY) { |
| 54 | CEL_ASSIGN_OR_RETURN(bool present, |
| 55 | struct_value.HasFieldByNumber(field_desc->number())); |
| 56 | if (!present) { |
| 57 | return NullValue(); |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | return struct_value.GetFieldByNumber(field_desc->number(), descriptor_pool, |
| 62 | message_factory, arena); |
| 63 | } |
| 64 | |
| 65 | } // namespace |
| 66 |
nothing calls this directly
no test coverage detected