// Code generated by ent, DO NOT EDIT.

package workflowcontractversion

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/chainloop-dev/chainloop/app/controlplane/pkg/unmarshal"
	"github.com/google/uuid"
)

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

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

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

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

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

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

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

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

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

// Body applies equality check predicate on the "body" field. It's identical to BodyEQ.
func Body(v []byte) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldEQ(FieldBody, v))
}

// RawBody applies equality check predicate on the "raw_body" field. It's identical to RawBodyEQ.
func RawBody(v []byte) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldEQ(FieldRawBody, v))
}

// Revision applies equality check predicate on the "revision" field. It's identical to RevisionEQ.
func Revision(v int) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldEQ(FieldRevision, v))
}

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

// BodyEQ applies the EQ predicate on the "body" field.
func BodyEQ(v []byte) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldEQ(FieldBody, v))
}

// BodyNEQ applies the NEQ predicate on the "body" field.
func BodyNEQ(v []byte) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldNEQ(FieldBody, v))
}

// BodyIn applies the In predicate on the "body" field.
func BodyIn(vs ...[]byte) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldIn(FieldBody, vs...))
}

// BodyNotIn applies the NotIn predicate on the "body" field.
func BodyNotIn(vs ...[]byte) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldNotIn(FieldBody, vs...))
}

// BodyGT applies the GT predicate on the "body" field.
func BodyGT(v []byte) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldGT(FieldBody, v))
}

// BodyGTE applies the GTE predicate on the "body" field.
func BodyGTE(v []byte) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldGTE(FieldBody, v))
}

// BodyLT applies the LT predicate on the "body" field.
func BodyLT(v []byte) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldLT(FieldBody, v))
}

// BodyLTE applies the LTE predicate on the "body" field.
func BodyLTE(v []byte) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldLTE(FieldBody, v))
}

// BodyIsNil applies the IsNil predicate on the "body" field.
func BodyIsNil() predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldIsNull(FieldBody))
}

// BodyNotNil applies the NotNil predicate on the "body" field.
func BodyNotNil() predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldNotNull(FieldBody))
}

// RawBodyEQ applies the EQ predicate on the "raw_body" field.
func RawBodyEQ(v []byte) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldEQ(FieldRawBody, v))
}

// RawBodyNEQ applies the NEQ predicate on the "raw_body" field.
func RawBodyNEQ(v []byte) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldNEQ(FieldRawBody, v))
}

// RawBodyIn applies the In predicate on the "raw_body" field.
func RawBodyIn(vs ...[]byte) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldIn(FieldRawBody, vs...))
}

// RawBodyNotIn applies the NotIn predicate on the "raw_body" field.
func RawBodyNotIn(vs ...[]byte) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldNotIn(FieldRawBody, vs...))
}

// RawBodyGT applies the GT predicate on the "raw_body" field.
func RawBodyGT(v []byte) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldGT(FieldRawBody, v))
}

// RawBodyGTE applies the GTE predicate on the "raw_body" field.
func RawBodyGTE(v []byte) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldGTE(FieldRawBody, v))
}

// RawBodyLT applies the LT predicate on the "raw_body" field.
func RawBodyLT(v []byte) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldLT(FieldRawBody, v))
}

// RawBodyLTE applies the LTE predicate on the "raw_body" field.
func RawBodyLTE(v []byte) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldLTE(FieldRawBody, v))
}

// RawBodyFormatEQ applies the EQ predicate on the "raw_body_format" field.
func RawBodyFormatEQ(v unmarshal.RawFormat) predicate.WorkflowContractVersion {
	vc := v
	return predicate.WorkflowContractVersion(sql.FieldEQ(FieldRawBodyFormat, vc))
}

// RawBodyFormatNEQ applies the NEQ predicate on the "raw_body_format" field.
func RawBodyFormatNEQ(v unmarshal.RawFormat) predicate.WorkflowContractVersion {
	vc := v
	return predicate.WorkflowContractVersion(sql.FieldNEQ(FieldRawBodyFormat, vc))
}

// RawBodyFormatIn applies the In predicate on the "raw_body_format" field.
func RawBodyFormatIn(vs ...unmarshal.RawFormat) predicate.WorkflowContractVersion {
	v := make([]any, len(vs))
	for i := range v {
		v[i] = vs[i]
	}
	return predicate.WorkflowContractVersion(sql.FieldIn(FieldRawBodyFormat, v...))
}

// RawBodyFormatNotIn applies the NotIn predicate on the "raw_body_format" field.
func RawBodyFormatNotIn(vs ...unmarshal.RawFormat) predicate.WorkflowContractVersion {
	v := make([]any, len(vs))
	for i := range v {
		v[i] = vs[i]
	}
	return predicate.WorkflowContractVersion(sql.FieldNotIn(FieldRawBodyFormat, v...))
}

// RevisionEQ applies the EQ predicate on the "revision" field.
func RevisionEQ(v int) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldEQ(FieldRevision, v))
}

// RevisionNEQ applies the NEQ predicate on the "revision" field.
func RevisionNEQ(v int) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldNEQ(FieldRevision, v))
}

// RevisionIn applies the In predicate on the "revision" field.
func RevisionIn(vs ...int) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldIn(FieldRevision, vs...))
}

// RevisionNotIn applies the NotIn predicate on the "revision" field.
func RevisionNotIn(vs ...int) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldNotIn(FieldRevision, vs...))
}

// RevisionGT applies the GT predicate on the "revision" field.
func RevisionGT(v int) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldGT(FieldRevision, v))
}

// RevisionGTE applies the GTE predicate on the "revision" field.
func RevisionGTE(v int) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldGTE(FieldRevision, v))
}

// RevisionLT applies the LT predicate on the "revision" field.
func RevisionLT(v int) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldLT(FieldRevision, v))
}

// RevisionLTE applies the LTE predicate on the "revision" field.
func RevisionLTE(v int) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.FieldLTE(FieldRevision, v))
}

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

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

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

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

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

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

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

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

// HasContract applies the HasEdge predicate on the "contract" edge.
func HasContract() predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.Edge(sqlgraph.M2O, true, ContractTable, ContractColumn),
		)
		sqlgraph.HasNeighbors(s, step)
	})
}

// HasContractWith applies the HasEdge predicate on the "contract" edge with a given conditions (other predicates).
func HasContractWith(preds ...predicate.WorkflowContract) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(func(s *sql.Selector) {
		step := newContractStep()
		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.WorkflowContractVersion) predicate.WorkflowContractVersion {
	return predicate.WorkflowContractVersion(sql.AndPredicates(predicates...))
}

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

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