| 140 | } |
| 141 | |
| 142 | absl::StatusOr<ExprMapValue> MapValueToExpr( |
| 143 | const MapValue& map_value, |
| 144 | const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool, |
| 145 | google::protobuf::MessageFactory* absl_nonnull message_factory, |
| 146 | google::protobuf::Arena* absl_nonnull arena) { |
| 147 | ExprMapValue result; |
| 148 | |
| 149 | CEL_ASSIGN_OR_RETURN(auto iter, map_value.NewIterator()); |
| 150 | |
| 151 | while (iter->HasNext()) { |
| 152 | CEL_ASSIGN_OR_RETURN(auto key_value, |
| 153 | iter->Next(descriptor_pool, message_factory, arena)); |
| 154 | CEL_ASSIGN_OR_RETURN( |
| 155 | auto value_value, |
| 156 | map_value.Get(key_value, descriptor_pool, message_factory, arena)); |
| 157 | |
| 158 | CEL_ASSIGN_OR_RETURN( |
| 159 | auto key, |
| 160 | ToExprValue(key_value, descriptor_pool, message_factory, arena)); |
| 161 | CEL_ASSIGN_OR_RETURN(auto value, |
| 162 | ToExprValue(value_value, descriptor_pool, |
| 163 | message_factory, arena)); |
| 164 | |
| 165 | auto* entry = result.add_entries(); |
| 166 | |
| 167 | *entry->mutable_key() = std::move(key); |
| 168 | *entry->mutable_value() = std::move(value); |
| 169 | } |
| 170 | |
| 171 | return result; |
| 172 | } |
| 173 | |
| 174 | absl::StatusOr<ExprListValue> ListValueToExpr( |
| 175 | const ListValue& list_value, |
no test coverage detected