| 42 | } // namespace |
| 43 | |
| 44 | CelAttributeQualifierPattern CreateCelAttributeQualifierPattern( |
| 45 | const CelValue& value) { |
| 46 | switch (value.type()) { |
| 47 | case cel::Kind::kInt64: |
| 48 | return CelAttributeQualifierPattern::OfInt(value.Int64OrDie()); |
| 49 | case cel::Kind::kUint64: |
| 50 | return CelAttributeQualifierPattern::OfUint(value.Uint64OrDie()); |
| 51 | case cel::Kind::kString: |
| 52 | return CelAttributeQualifierPattern::OfString( |
| 53 | std::string(value.StringOrDie().value())); |
| 54 | case cel::Kind::kBool: |
| 55 | return CelAttributeQualifierPattern::OfBool(value.BoolOrDie()); |
| 56 | default: |
| 57 | return CelAttributeQualifierPattern(CelAttributeQualifier()); |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | CelAttributeQualifier CreateCelAttributeQualifier(const CelValue& value) { |
| 62 | switch (value.type()) { |