// Code generated by ent, DO NOT EDIT.

package totpcredential

import (
	"PasswordManager/ent/predicate"

	"entgo.io/ent/dialect/sql"
	"entgo.io/ent/dialect/sql/sqlgraph"
	"github.com/google/uuid"
)

// ID filters vertices based on their ID field.
func ID(id uuid.UUID) predicate.TotpCredential {
	return predicate.TotpCredential(sql.FieldEQ(FieldID, id))
}

// IDEQ applies the EQ predicate on the ID field.
func IDEQ(id uuid.UUID) predicate.TotpCredential {
	return predicate.TotpCredential(sql.FieldEQ(FieldID, id))
}

// IDNEQ applies the NEQ predicate on the ID field.
func IDNEQ(id uuid.UUID) predicate.TotpCredential {
	return predicate.TotpCredential(sql.FieldNEQ(FieldID, id))
}

// IDIn applies the In predicate on the ID field.
func IDIn(ids ...uuid.UUID) predicate.TotpCredential {
	return predicate.TotpCredential(sql.FieldIn(FieldID, ids...))
}

// IDNotIn applies the NotIn predicate on the ID field.
func IDNotIn(ids ...uuid.UUID) predicate.TotpCredential {
	return predicate.TotpCredential(sql.FieldNotIn(FieldID, ids...))
}

// IDGT applies the GT predicate on the ID field.
func IDGT(id uuid.UUID) predicate.TotpCredential {
	return predicate.TotpCredential(sql.FieldGT(FieldID, id))
}

// IDGTE applies the GTE predicate on the ID field.
func IDGTE(id uuid.UUID) predicate.TotpCredential {
	return predicate.TotpCredential(sql.FieldGTE(FieldID, id))
}

// IDLT applies the LT predicate on the ID field.
func IDLT(id uuid.UUID) predicate.TotpCredential {
	return predicate.TotpCredential(sql.FieldLT(FieldID, id))
}

// IDLTE applies the LTE predicate on the ID field.
func IDLTE(id uuid.UUID) predicate.TotpCredential {
	return predicate.TotpCredential(sql.FieldLTE(FieldID, id))
}

// Secret applies equality check predicate on the "secret" field. It's identical to SecretEQ.
func Secret(v string) predicate.TotpCredential {
	return predicate.TotpCredential(sql.FieldEQ(FieldSecret, v))
}

// Validated applies equality check predicate on the "validated" field. It's identical to ValidatedEQ.
func Validated(v bool) predicate.TotpCredential {
	return predicate.TotpCredential(sql.FieldEQ(FieldValidated, v))
}

// SecretEQ applies the EQ predicate on the "secret" field.
func SecretEQ(v string) predicate.TotpCredential {
	return predicate.TotpCredential(sql.FieldEQ(FieldSecret, v))
}

// SecretNEQ applies the NEQ predicate on the "secret" field.
func SecretNEQ(v string) predicate.TotpCredential {
	return predicate.TotpCredential(sql.FieldNEQ(FieldSecret, v))
}

// SecretIn applies the In predicate on the "secret" field.
func SecretIn(vs ...string) predicate.TotpCredential {
	return predicate.TotpCredential(sql.FieldIn(FieldSecret, vs...))
}

// SecretNotIn applies the NotIn predicate on the "secret" field.
func SecretNotIn(vs ...string) predicate.TotpCredential {
	return predicate.TotpCredential(sql.FieldNotIn(FieldSecret, vs...))
}

// SecretGT applies the GT predicate on the "secret" field.
func SecretGT(v string) predicate.TotpCredential {
	return predicate.TotpCredential(sql.FieldGT(FieldSecret, v))
}

// SecretGTE applies the GTE predicate on the "secret" field.
func SecretGTE(v string) predicate.TotpCredential {
	return predicate.TotpCredential(sql.FieldGTE(FieldSecret, v))
}

// SecretLT applies the LT predicate on the "secret" field.
func SecretLT(v string) predicate.TotpCredential {
	return predicate.TotpCredential(sql.FieldLT(FieldSecret, v))
}

// SecretLTE applies the LTE predicate on the "secret" field.
func SecretLTE(v string) predicate.TotpCredential {
	return predicate.TotpCredential(sql.FieldLTE(FieldSecret, v))
}

// SecretContains applies the Contains predicate on the "secret" field.
func SecretContains(v string) predicate.TotpCredential {
	return predicate.TotpCredential(sql.FieldContains(FieldSecret, v))
}

// SecretHasPrefix applies the HasPrefix predicate on the "secret" field.
func SecretHasPrefix(v string) predicate.TotpCredential {
	return predicate.TotpCredential(sql.FieldHasPrefix(FieldSecret, v))
}

// SecretHasSuffix applies the HasSuffix predicate on the "secret" field.
func SecretHasSuffix(v string) predicate.TotpCredential {
	return predicate.TotpCredential(sql.FieldHasSuffix(FieldSecret, v))
}

// SecretEqualFold applies the EqualFold predicate on the "secret" field.
func SecretEqualFold(v string) predicate.TotpCredential {
	return predicate.TotpCredential(sql.FieldEqualFold(FieldSecret, v))
}

// SecretContainsFold applies the ContainsFold predicate on the "secret" field.
func SecretContainsFold(v string) predicate.TotpCredential {
	return predicate.TotpCredential(sql.FieldContainsFold(FieldSecret, v))
}

// ValidatedEQ applies the EQ predicate on the "validated" field.
func ValidatedEQ(v bool) predicate.TotpCredential {
	return predicate.TotpCredential(sql.FieldEQ(FieldValidated, v))
}

// ValidatedNEQ applies the NEQ predicate on the "validated" field.
func ValidatedNEQ(v bool) predicate.TotpCredential {
	return predicate.TotpCredential(sql.FieldNEQ(FieldValidated, v))
}

// HasUser applies the HasEdge predicate on the "user" edge.
func HasUser() predicate.TotpCredential {
	return predicate.TotpCredential(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.Edge(sqlgraph.O2O, true, UserTable, UserColumn),
		)
		sqlgraph.HasNeighbors(s, step)
	})
}

// HasUserWith applies the HasEdge predicate on the "user" edge with a given conditions (other predicates).
func HasUserWith(preds ...predicate.User) predicate.TotpCredential {
	return predicate.TotpCredential(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.To(UserInverseTable, FieldID),
			sqlgraph.Edge(sqlgraph.O2O, true, UserTable, UserColumn),
		)
		sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
			for _, p := range preds {
				p(s)
			}
		})
	})
}

// HasChallenge applies the HasEdge predicate on the "challenge" edge.
func HasChallenge() predicate.TotpCredential {
	return predicate.TotpCredential(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.Edge(sqlgraph.O2O, true, ChallengeTable, ChallengeColumn),
		)
		sqlgraph.HasNeighbors(s, step)
	})
}

// HasChallengeWith applies the HasEdge predicate on the "challenge" edge with a given conditions (other predicates).
func HasChallengeWith(preds ...predicate.Challenge) predicate.TotpCredential {
	return predicate.TotpCredential(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.To(ChallengeInverseTable, FieldID),
			sqlgraph.Edge(sqlgraph.O2O, true, ChallengeTable, ChallengeColumn),
		)
		sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
			for _, p := range preds {
				p(s)
			}
		})
	})
}

// And groups predicates with the AND operator between them.
func And(predicates ...predicate.TotpCredential) predicate.TotpCredential {
	return predicate.TotpCredential(func(s *sql.Selector) {
		s1 := s.Clone().SetP(nil)
		for _, p := range predicates {
			p(s1)
		}
		s.Where(s1.P())
	})
}

// Or groups predicates with the OR operator between them.
func Or(predicates ...predicate.TotpCredential) predicate.TotpCredential {
	return predicate.TotpCredential(func(s *sql.Selector) {
		s1 := s.Clone().SetP(nil)
		for i, p := range predicates {
			if i > 0 {
				s1.Or()
			}
			p(s1)
		}
		s.Where(s1.P())
	})
}

// Not applies the not operator on the given predicate.
func Not(p predicate.TotpCredential) predicate.TotpCredential {
	return predicate.TotpCredential(func(s *sql.Selector) {
		p(s.Not())
	})
}
