| 53 | } |
| 54 | |
| 55 | absl::StatusOr<absl::variant<VariableDecl, FunctionDecl>> DeclFromV1Alpha1Proto( |
| 56 | const google::api::expr::v1alpha1::Decl& decl, |
| 57 | const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool, |
| 58 | google::protobuf::Arena* absl_nonnull arena) { |
| 59 | cel::expr::Decl unversioned; |
| 60 | if (!unversioned.MergeFromString(decl.SerializeAsString())) { |
| 61 | return absl::InternalError( |
| 62 | "failed to convert versioned to unversioned Decl proto"); |
| 63 | } |
| 64 | return DeclFromProto(unversioned, descriptor_pool, arena); |
| 65 | } |
| 66 | |
| 67 | } // namespace cel |