| 75 | } |
| 76 | |
| 77 | CelAttributePattern CreateCelAttributePattern( |
| 78 | absl::string_view variable, |
| 79 | std::initializer_list<absl::variant<absl::string_view, int64_t, uint64_t, |
| 80 | bool, CelAttributeQualifierPattern>> |
| 81 | path_spec) { |
| 82 | std::vector<CelAttributeQualifierPattern> path; |
| 83 | path.reserve(path_spec.size()); |
| 84 | for (const auto& spec_elem : path_spec) { |
| 85 | path.emplace_back(absl::visit(QualifierVisitor(), spec_elem)); |
| 86 | } |
| 87 | return CelAttributePattern(std::string(variable), std::move(path)); |
| 88 | } |
| 89 | |
| 90 | } // namespace google::api::expr::runtime |