| 209 | } // namespace |
| 210 | |
| 211 | absl::StatusOr<Value> FromExprValue( |
| 212 | const cel::expr::Value& value, |
| 213 | const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool, |
| 214 | google::protobuf::MessageFactory* absl_nonnull message_factory, |
| 215 | google::protobuf::Arena* absl_nonnull arena) { |
| 216 | google::protobuf::LinkMessageReflection<cel::expr::Value>(); |
| 217 | switch (value.kind_case()) { |
| 218 | case ExprValueKind::kBoolValue: |
| 219 | return cel::BoolValue(value.bool_value()); |
| 220 | case ExprValueKind::kInt64Value: |
| 221 | return cel::IntValue(value.int64_value()); |
| 222 | case ExprValueKind::kUint64Value: |
| 223 | return cel::UintValue(value.uint64_value()); |
| 224 | case ExprValueKind::kDoubleValue: |
| 225 | return cel::DoubleValue(value.double_value()); |
| 226 | case ExprValueKind::kStringValue: |
| 227 | return cel::StringValue(value.string_value()); |
| 228 | case ExprValueKind::kBytesValue: |
| 229 | return cel::BytesValue(value.bytes_value()); |
| 230 | case ExprValueKind::kNullValue: |
| 231 | return cel::NullValue(); |
| 232 | case ExprValueKind::kObjectValue: |
| 233 | return FromObject(value.object_value(), descriptor_pool, message_factory, |
| 234 | arena); |
| 235 | case ExprValueKind::kMapValue: |
| 236 | return MapValueFromExpr(value.map_value(), descriptor_pool, |
| 237 | message_factory, arena); |
| 238 | case ExprValueKind::kListValue: |
| 239 | return ListValueFromExpr(value.list_value(), descriptor_pool, |
| 240 | message_factory, arena); |
| 241 | |
| 242 | default: |
| 243 | return absl::UnimplementedError(absl::StrCat( |
| 244 | "FromExprValue not supported ", ToString(value.kind_case()))); |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | absl::StatusOr<cel::expr::Value> ToExprValue( |
| 249 | const Value& value, |
no test coverage detected