| 1 |
// Code generated by ent, DO NOT EDIT. |
| 2 |
|
| 3 |
package attestationpolicy |
| 4 |
|
| 5 |
import ( |
| 6 |
"entgo.io/ent/dialect/sql" |
| 7 |
"entgo.io/ent/dialect/sql/sqlgraph" |
| 8 |
"github.com/google/uuid" |
| 9 |
"github.com/in-toto/archivista/ent/predicate" |
| 10 |
) |
| 11 |
|
| 12 |
// ID filters vertices based on their ID field. |
| 13 |
func ID(id uuid.UUID) predicate.AttestationPolicy { |
| 14 |
return predicate.AttestationPolicy(sql.FieldEQ(FieldID, id)) |
| 15 |
} |
| 16 |
|
| 17 |
// IDEQ applies the EQ predicate on the ID field. |
| 18 |
func IDEQ(id uuid.UUID) predicate.AttestationPolicy { |
| 19 |
return predicate.AttestationPolicy(sql.FieldEQ(FieldID, id)) |
| 20 |
} |
| 21 |
|
| 22 |
// IDNEQ applies the NEQ predicate on the ID field. |
| 23 |
func IDNEQ(id uuid.UUID) predicate.AttestationPolicy { |
| 24 |
return predicate.AttestationPolicy(sql.FieldNEQ(FieldID, id)) |
| 25 |
} |
| 26 |
|
| 27 |
// IDIn applies the In predicate on the ID field. |
| 28 |
func IDIn(ids ...uuid.UUID) predicate.AttestationPolicy { |
| 29 |
return predicate.AttestationPolicy(sql.FieldIn(FieldID, ids...)) |
| 30 |
} |
| 31 |
|
| 32 |
// IDNotIn applies the NotIn predicate on the ID field. |
| 33 |
func IDNotIn(ids ...uuid.UUID) predicate.AttestationPolicy { |
| 34 |
return predicate.AttestationPolicy(sql.FieldNotIn(FieldID, ids...)) |
| 35 |
} |
| 36 |
|
| 37 |
// IDGT applies the GT predicate on the ID field. |
| 38 |
func IDGT(id uuid.UUID) predicate.AttestationPolicy { |
| 39 |
return predicate.AttestationPolicy(sql.FieldGT(FieldID, id)) |
| 40 |
} |
| 41 |
|
| 42 |
// IDGTE applies the GTE predicate on the ID field. |
| 43 |
func IDGTE(id uuid.UUID) predicate.AttestationPolicy { |
| 44 |
return predicate.AttestationPolicy(sql.FieldGTE(FieldID, id)) |
| 45 |
} |
| 46 |
|
| 47 |
// IDLT applies the LT predicate on the ID field. |
| 48 |
func IDLT(id uuid.UUID) predicate.AttestationPolicy { |
| 49 |
return predicate.AttestationPolicy(sql.FieldLT(FieldID, id)) |
| 50 |
} |
| 51 |
|
| 52 |
// IDLTE applies the LTE predicate on the ID field. |
| 53 |
func IDLTE(id uuid.UUID) predicate.AttestationPolicy { |
| 54 |
return predicate.AttestationPolicy(sql.FieldLTE(FieldID, id)) |
| 55 |
} |
| 56 |
|
| 57 |
// Name applies equality check predicate on the "name" field. It's identical to NameEQ. |
| 58 |
func Name(v string) predicate.AttestationPolicy { |
| 59 |
return predicate.AttestationPolicy(sql.FieldEQ(FieldName, v)) |
| 60 |
} |
| 61 |
|
| 62 |
// NameEQ applies the EQ predicate on the "name" field. |
| 63 |
func NameEQ(v string) predicate.AttestationPolicy { |
| 64 |
return predicate.AttestationPolicy(sql.FieldEQ(FieldName, v)) |
| 65 |
} |
| 66 |
|
| 67 |
// NameNEQ applies the NEQ predicate on the "name" field. |
| 68 |
func NameNEQ(v string) predicate.AttestationPolicy { |
| 69 |
return predicate.AttestationPolicy(sql.FieldNEQ(FieldName, v)) |
| 70 |
} |
| 71 |
|
| 72 |
// NameIn applies the In predicate on the "name" field. |
| 73 |
func NameIn(vs ...string) predicate.AttestationPolicy { |
| 74 |
return predicate.AttestationPolicy(sql.FieldIn(FieldName, vs...)) |
| 75 |
} |
| 76 |
|
| 77 |
// NameNotIn applies the NotIn predicate on the "name" field. |
| 78 |
func NameNotIn(vs ...string) predicate.AttestationPolicy { |
| 79 |
return predicate.AttestationPolicy(sql.FieldNotIn(FieldName, vs...)) |
| 80 |
} |
| 81 |
|
| 82 |
// NameGT applies the GT predicate on the "name" field. |
| 83 |
func NameGT(v string) predicate.AttestationPolicy { |
| 84 |
return predicate.AttestationPolicy(sql.FieldGT(FieldName, v)) |
| 85 |
} |
| 86 |
|
| 87 |
// NameGTE applies the GTE predicate on the "name" field. |
| 88 |
func NameGTE(v string) predicate.AttestationPolicy { |
| 89 |
return predicate.AttestationPolicy(sql.FieldGTE(FieldName, v)) |
| 90 |
} |
| 91 |
|
| 92 |
// NameLT applies the LT predicate on the "name" field. |
| 93 |
func NameLT(v string) predicate.AttestationPolicy { |
| 94 |
return predicate.AttestationPolicy(sql.FieldLT(FieldName, v)) |
| 95 |
} |
| 96 |
|
| 97 |
// NameLTE applies the LTE predicate on the "name" field. |
| 98 |
func NameLTE(v string) predicate.AttestationPolicy { |
| 99 |
return predicate.AttestationPolicy(sql.FieldLTE(FieldName, v)) |
| 100 |
} |
| 101 |
|
| 102 |
// NameContains applies the Contains predicate on the "name" field. |
| 103 |
func NameContains(v string) predicate.AttestationPolicy { |
| 104 |
return predicate.AttestationPolicy(sql.FieldContains(FieldName, v)) |
| 105 |
} |
| 106 |
|
| 107 |
// NameHasPrefix applies the HasPrefix predicate on the "name" field. |
| 108 |
func NameHasPrefix(v string) predicate.AttestationPolicy { |
| 109 |
return predicate.AttestationPolicy(sql.FieldHasPrefix(FieldName, v)) |
| 110 |
} |
| 111 |
|
| 112 |
// NameHasSuffix applies the HasSuffix predicate on the "name" field. |
| 113 |
func NameHasSuffix(v string) predicate.AttestationPolicy { |
| 114 |
return predicate.AttestationPolicy(sql.FieldHasSuffix(FieldName, v)) |
| 115 |
} |
| 116 |
|
| 117 |
// NameEqualFold applies the EqualFold predicate on the "name" field. |
| 118 |
func NameEqualFold(v string) predicate.AttestationPolicy { |
| 119 |
return predicate.AttestationPolicy(sql.FieldEqualFold(FieldName, v)) |
| 120 |
} |
| 121 |
|
| 122 |
// NameContainsFold applies the ContainsFold predicate on the "name" field. |
| 123 |
func NameContainsFold(v string) predicate.AttestationPolicy { |
| 124 |
return predicate.AttestationPolicy(sql.FieldContainsFold(FieldName, v)) |
| 125 |
} |
| 126 |
|
| 127 |
// HasStatement applies the HasEdge predicate on the "statement" edge. |
| 128 |
func HasStatement() predicate.AttestationPolicy { |
| 129 |
return predicate.AttestationPolicy(func(s *sql.Selector) { |
| 130 |
step := sqlgraph.NewStep( |
| 131 |
sqlgraph.From(Table, FieldID), |
| 132 |
sqlgraph.Edge(sqlgraph.O2O, true, StatementTable, StatementColumn), |
| 133 |
) |
| 134 |
sqlgraph.HasNeighbors(s, step) |
| 135 |
}) |
| 136 |
} |
| 137 |
|
| 138 |
// HasStatementWith applies the HasEdge predicate on the "statement" edge with a given conditions (other predicates). |
| 139 |
func HasStatementWith(preds ...predicate.Statement) predicate.AttestationPolicy { |
| 140 |
return predicate.AttestationPolicy(func(s *sql.Selector) { |
| 141 |
step := newStatementStep() |
| 142 |
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { |
| 143 |
for _, p := range preds { |
| 144 |
p(s) |
| 145 |
} |
| 146 |
}) |
| 147 |
}) |
| 148 |
} |
| 149 |
|
| 150 |
// And groups predicates with the AND operator between them. |
| 151 |
func And(predicates ...predicate.AttestationPolicy) predicate.AttestationPolicy { |
| 152 |
return predicate.AttestationPolicy(sql.AndPredicates(predicates...)) |
| 153 |
} |
| 154 |
|
| 155 |
// Or groups predicates with the OR operator between them. |
| 156 |
func Or(predicates ...predicate.AttestationPolicy) predicate.AttestationPolicy { |
| 157 |
return predicate.AttestationPolicy(sql.OrPredicates(predicates...)) |
| 158 |
} |
| 159 |
|
| 160 |
// Not applies the not operator on the given predicate. |
| 161 |
func Not(p predicate.AttestationPolicy) predicate.AttestationPolicy { |
| 162 |
return predicate.AttestationPolicy(sql.NotPredicates(p)) |
| 163 |
} |