// Code generated by ent, DO NOT EDIT.

package referrer

import (
	"time"

	"entgo.io/ent/dialect/sql"
	"entgo.io/ent/dialect/sql/sqlgraph"
	"github.com/chainloop-dev/chainloop/app/controlplane/pkg/data/ent/predicate"
	"github.com/google/uuid"
)

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

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

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

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

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

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

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

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

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

// Digest applies equality check predicate on the "digest" field. It's identical to DigestEQ.
func Digest(v string) predicate.Referrer {
	return predicate.Referrer(sql.FieldEQ(FieldDigest, v))
}

// Kind applies equality check predicate on the "kind" field. It's identical to KindEQ.
func Kind(v string) predicate.Referrer {
	return predicate.Referrer(sql.FieldEQ(FieldKind, v))
}

// Downloadable applies equality check predicate on the "downloadable" field. It's identical to DownloadableEQ.
func Downloadable(v bool) predicate.Referrer {
	return predicate.Referrer(sql.FieldEQ(FieldDownloadable, v))
}

// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
func CreatedAt(v time.Time) predicate.Referrer {
	return predicate.Referrer(sql.FieldEQ(FieldCreatedAt, v))
}

// DigestEQ applies the EQ predicate on the "digest" field.
func DigestEQ(v string) predicate.Referrer {
	return predicate.Referrer(sql.FieldEQ(FieldDigest, v))
}

// DigestNEQ applies the NEQ predicate on the "digest" field.
func DigestNEQ(v string) predicate.Referrer {
	return predicate.Referrer(sql.FieldNEQ(FieldDigest, v))
}

// DigestIn applies the In predicate on the "digest" field.
func DigestIn(vs ...string) predicate.Referrer {
	return predicate.Referrer(sql.FieldIn(FieldDigest, vs...))
}

// DigestNotIn applies the NotIn predicate on the "digest" field.
func DigestNotIn(vs ...string) predicate.Referrer {
	return predicate.Referrer(sql.FieldNotIn(FieldDigest, vs...))
}

// DigestGT applies the GT predicate on the "digest" field.
func DigestGT(v string) predicate.Referrer {
	return predicate.Referrer(sql.FieldGT(FieldDigest, v))
}

// DigestGTE applies the GTE predicate on the "digest" field.
func DigestGTE(v string) predicate.Referrer {
	return predicate.Referrer(sql.FieldGTE(FieldDigest, v))
}

// DigestLT applies the LT predicate on the "digest" field.
func DigestLT(v string) predicate.Referrer {
	return predicate.Referrer(sql.FieldLT(FieldDigest, v))
}

// DigestLTE applies the LTE predicate on the "digest" field.
func DigestLTE(v string) predicate.Referrer {
	return predicate.Referrer(sql.FieldLTE(FieldDigest, v))
}

// DigestContains applies the Contains predicate on the "digest" field.
func DigestContains(v string) predicate.Referrer {
	return predicate.Referrer(sql.FieldContains(FieldDigest, v))
}

// DigestHasPrefix applies the HasPrefix predicate on the "digest" field.
func DigestHasPrefix(v string) predicate.Referrer {
	return predicate.Referrer(sql.FieldHasPrefix(FieldDigest, v))
}

// DigestHasSuffix applies the HasSuffix predicate on the "digest" field.
func DigestHasSuffix(v string) predicate.Referrer {
	return predicate.Referrer(sql.FieldHasSuffix(FieldDigest, v))
}

// DigestEqualFold applies the EqualFold predicate on the "digest" field.
func DigestEqualFold(v string) predicate.Referrer {
	return predicate.Referrer(sql.FieldEqualFold(FieldDigest, v))
}

// DigestContainsFold applies the ContainsFold predicate on the "digest" field.
func DigestContainsFold(v string) predicate.Referrer {
	return predicate.Referrer(sql.FieldContainsFold(FieldDigest, v))
}

// KindEQ applies the EQ predicate on the "kind" field.
func KindEQ(v string) predicate.Referrer {
	return predicate.Referrer(sql.FieldEQ(FieldKind, v))
}

// KindNEQ applies the NEQ predicate on the "kind" field.
func KindNEQ(v string) predicate.Referrer {
	return predicate.Referrer(sql.FieldNEQ(FieldKind, v))
}

// KindIn applies the In predicate on the "kind" field.
func KindIn(vs ...string) predicate.Referrer {
	return predicate.Referrer(sql.FieldIn(FieldKind, vs...))
}

// KindNotIn applies the NotIn predicate on the "kind" field.
func KindNotIn(vs ...string) predicate.Referrer {
	return predicate.Referrer(sql.FieldNotIn(FieldKind, vs...))
}

// KindGT applies the GT predicate on the "kind" field.
func KindGT(v string) predicate.Referrer {
	return predicate.Referrer(sql.FieldGT(FieldKind, v))
}

// KindGTE applies the GTE predicate on the "kind" field.
func KindGTE(v string) predicate.Referrer {
	return predicate.Referrer(sql.FieldGTE(FieldKind, v))
}

// KindLT applies the LT predicate on the "kind" field.
func KindLT(v string) predicate.Referrer {
	return predicate.Referrer(sql.FieldLT(FieldKind, v))
}

// KindLTE applies the LTE predicate on the "kind" field.
func KindLTE(v string) predicate.Referrer {
	return predicate.Referrer(sql.FieldLTE(FieldKind, v))
}

// KindContains applies the Contains predicate on the "kind" field.
func KindContains(v string) predicate.Referrer {
	return predicate.Referrer(sql.FieldContains(FieldKind, v))
}

// KindHasPrefix applies the HasPrefix predicate on the "kind" field.
func KindHasPrefix(v string) predicate.Referrer {
	return predicate.Referrer(sql.FieldHasPrefix(FieldKind, v))
}

// KindHasSuffix applies the HasSuffix predicate on the "kind" field.
func KindHasSuffix(v string) predicate.Referrer {
	return predicate.Referrer(sql.FieldHasSuffix(FieldKind, v))
}

// KindEqualFold applies the EqualFold predicate on the "kind" field.
func KindEqualFold(v string) predicate.Referrer {
	return predicate.Referrer(sql.FieldEqualFold(FieldKind, v))
}

// KindContainsFold applies the ContainsFold predicate on the "kind" field.
func KindContainsFold(v string) predicate.Referrer {
	return predicate.Referrer(sql.FieldContainsFold(FieldKind, v))
}

// DownloadableEQ applies the EQ predicate on the "downloadable" field.
func DownloadableEQ(v bool) predicate.Referrer {
	return predicate.Referrer(sql.FieldEQ(FieldDownloadable, v))
}

// DownloadableNEQ applies the NEQ predicate on the "downloadable" field.
func DownloadableNEQ(v bool) predicate.Referrer {
	return predicate.Referrer(sql.FieldNEQ(FieldDownloadable, v))
}

// CreatedAtEQ applies the EQ predicate on the "created_at" field.
func CreatedAtEQ(v time.Time) predicate.Referrer {
	return predicate.Referrer(sql.FieldEQ(FieldCreatedAt, v))
}

// CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
func CreatedAtNEQ(v time.Time) predicate.Referrer {
	return predicate.Referrer(sql.FieldNEQ(FieldCreatedAt, v))
}

// CreatedAtIn applies the In predicate on the "created_at" field.
func CreatedAtIn(vs ...time.Time) predicate.Referrer {
	return predicate.Referrer(sql.FieldIn(FieldCreatedAt, vs...))
}

// CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
func CreatedAtNotIn(vs ...time.Time) predicate.Referrer {
	return predicate.Referrer(sql.FieldNotIn(FieldCreatedAt, vs...))
}

// CreatedAtGT applies the GT predicate on the "created_at" field.
func CreatedAtGT(v time.Time) predicate.Referrer {
	return predicate.Referrer(sql.FieldGT(FieldCreatedAt, v))
}

// CreatedAtGTE applies the GTE predicate on the "created_at" field.
func CreatedAtGTE(v time.Time) predicate.Referrer {
	return predicate.Referrer(sql.FieldGTE(FieldCreatedAt, v))
}

// CreatedAtLT applies the LT predicate on the "created_at" field.
func CreatedAtLT(v time.Time) predicate.Referrer {
	return predicate.Referrer(sql.FieldLT(FieldCreatedAt, v))
}

// CreatedAtLTE applies the LTE predicate on the "created_at" field.
func CreatedAtLTE(v time.Time) predicate.Referrer {
	return predicate.Referrer(sql.FieldLTE(FieldCreatedAt, v))
}

// MetadataIsNil applies the IsNil predicate on the "metadata" field.
func MetadataIsNil() predicate.Referrer {
	return predicate.Referrer(sql.FieldIsNull(FieldMetadata))
}

// MetadataNotNil applies the NotNil predicate on the "metadata" field.
func MetadataNotNil() predicate.Referrer {
	return predicate.Referrer(sql.FieldNotNull(FieldMetadata))
}

// AnnotationsIsNil applies the IsNil predicate on the "annotations" field.
func AnnotationsIsNil() predicate.Referrer {
	return predicate.Referrer(sql.FieldIsNull(FieldAnnotations))
}

// AnnotationsNotNil applies the NotNil predicate on the "annotations" field.
func AnnotationsNotNil() predicate.Referrer {
	return predicate.Referrer(sql.FieldNotNull(FieldAnnotations))
}

// HasReferredBy applies the HasEdge predicate on the "referred_by" edge.
func HasReferredBy() predicate.Referrer {
	return predicate.Referrer(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.Edge(sqlgraph.M2M, true, ReferredByTable, ReferredByPrimaryKey...),
		)
		sqlgraph.HasNeighbors(s, step)
	})
}

// HasReferredByWith applies the HasEdge predicate on the "referred_by" edge with a given conditions (other predicates).
func HasReferredByWith(preds ...predicate.Referrer) predicate.Referrer {
	return predicate.Referrer(func(s *sql.Selector) {
		step := newReferredByStep()
		sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
			for _, p := range preds {
				p(s)
			}
		})
	})
}

// HasReferences applies the HasEdge predicate on the "references" edge.
func HasReferences() predicate.Referrer {
	return predicate.Referrer(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.Edge(sqlgraph.M2M, false, ReferencesTable, ReferencesPrimaryKey...),
		)
		sqlgraph.HasNeighbors(s, step)
	})
}

// HasReferencesWith applies the HasEdge predicate on the "references" edge with a given conditions (other predicates).
func HasReferencesWith(preds ...predicate.Referrer) predicate.Referrer {
	return predicate.Referrer(func(s *sql.Selector) {
		step := newReferencesStep()
		sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
			for _, p := range preds {
				p(s)
			}
		})
	})
}

// HasWorkflows applies the HasEdge predicate on the "workflows" edge.
func HasWorkflows() predicate.Referrer {
	return predicate.Referrer(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.Edge(sqlgraph.M2M, false, WorkflowsTable, WorkflowsPrimaryKey...),
		)
		sqlgraph.HasNeighbors(s, step)
	})
}

// HasWorkflowsWith applies the HasEdge predicate on the "workflows" edge with a given conditions (other predicates).
func HasWorkflowsWith(preds ...predicate.Workflow) predicate.Referrer {
	return predicate.Referrer(func(s *sql.Selector) {
		step := newWorkflowsStep()
		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.Referrer) predicate.Referrer {
	return predicate.Referrer(sql.AndPredicates(predicates...))
}

// Or groups predicates with the OR operator between them.
func Or(predicates ...predicate.Referrer) predicate.Referrer {
	return predicate.Referrer(sql.OrPredicates(predicates...))
}

// Not applies the not operator on the given predicate.
func Not(p predicate.Referrer) predicate.Referrer {
	return predicate.Referrer(sql.NotPredicates(p))
}
