// Code generated by ent, DO NOT EDIT.

package taskrecord

import (
	"time"

	"entgo.io/ent/dialect/sql"
	"entgo.io/ent/dialect/sql/sqlgraph"
	"github.com/chaitin/MonkeyCode/backend/consts"
	"github.com/chaitin/MonkeyCode/backend/db/predicate"
	"github.com/google/uuid"
)

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

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

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

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

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

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

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

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

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

// TaskID applies equality check predicate on the "task_id" field. It's identical to TaskIDEQ.
func TaskID(v uuid.UUID) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldEQ(FieldTaskID, v))
}

// Prompt applies equality check predicate on the "prompt" field. It's identical to PromptEQ.
func Prompt(v string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldEQ(FieldPrompt, v))
}

// Role applies equality check predicate on the "role" field. It's identical to RoleEQ.
func Role(v consts.ChatRole) predicate.TaskRecord {
	vc := string(v)
	return predicate.TaskRecord(sql.FieldEQ(FieldRole, vc))
}

// Completion applies equality check predicate on the "completion" field. It's identical to CompletionEQ.
func Completion(v string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldEQ(FieldCompletion, v))
}

// OutputTokens applies equality check predicate on the "output_tokens" field. It's identical to OutputTokensEQ.
func OutputTokens(v int64) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldEQ(FieldOutputTokens, v))
}

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

// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
func UpdatedAt(v time.Time) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldEQ(FieldUpdatedAt, v))
}

// TaskIDEQ applies the EQ predicate on the "task_id" field.
func TaskIDEQ(v uuid.UUID) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldEQ(FieldTaskID, v))
}

// TaskIDNEQ applies the NEQ predicate on the "task_id" field.
func TaskIDNEQ(v uuid.UUID) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldNEQ(FieldTaskID, v))
}

// TaskIDIn applies the In predicate on the "task_id" field.
func TaskIDIn(vs ...uuid.UUID) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldIn(FieldTaskID, vs...))
}

// TaskIDNotIn applies the NotIn predicate on the "task_id" field.
func TaskIDNotIn(vs ...uuid.UUID) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldNotIn(FieldTaskID, vs...))
}

// TaskIDIsNil applies the IsNil predicate on the "task_id" field.
func TaskIDIsNil() predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldIsNull(FieldTaskID))
}

// TaskIDNotNil applies the NotNil predicate on the "task_id" field.
func TaskIDNotNil() predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldNotNull(FieldTaskID))
}

// PromptEQ applies the EQ predicate on the "prompt" field.
func PromptEQ(v string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldEQ(FieldPrompt, v))
}

// PromptNEQ applies the NEQ predicate on the "prompt" field.
func PromptNEQ(v string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldNEQ(FieldPrompt, v))
}

// PromptIn applies the In predicate on the "prompt" field.
func PromptIn(vs ...string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldIn(FieldPrompt, vs...))
}

// PromptNotIn applies the NotIn predicate on the "prompt" field.
func PromptNotIn(vs ...string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldNotIn(FieldPrompt, vs...))
}

// PromptGT applies the GT predicate on the "prompt" field.
func PromptGT(v string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldGT(FieldPrompt, v))
}

// PromptGTE applies the GTE predicate on the "prompt" field.
func PromptGTE(v string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldGTE(FieldPrompt, v))
}

// PromptLT applies the LT predicate on the "prompt" field.
func PromptLT(v string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldLT(FieldPrompt, v))
}

// PromptLTE applies the LTE predicate on the "prompt" field.
func PromptLTE(v string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldLTE(FieldPrompt, v))
}

// PromptContains applies the Contains predicate on the "prompt" field.
func PromptContains(v string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldContains(FieldPrompt, v))
}

// PromptHasPrefix applies the HasPrefix predicate on the "prompt" field.
func PromptHasPrefix(v string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldHasPrefix(FieldPrompt, v))
}

// PromptHasSuffix applies the HasSuffix predicate on the "prompt" field.
func PromptHasSuffix(v string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldHasSuffix(FieldPrompt, v))
}

// PromptIsNil applies the IsNil predicate on the "prompt" field.
func PromptIsNil() predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldIsNull(FieldPrompt))
}

// PromptNotNil applies the NotNil predicate on the "prompt" field.
func PromptNotNil() predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldNotNull(FieldPrompt))
}

// PromptEqualFold applies the EqualFold predicate on the "prompt" field.
func PromptEqualFold(v string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldEqualFold(FieldPrompt, v))
}

// PromptContainsFold applies the ContainsFold predicate on the "prompt" field.
func PromptContainsFold(v string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldContainsFold(FieldPrompt, v))
}

// RoleEQ applies the EQ predicate on the "role" field.
func RoleEQ(v consts.ChatRole) predicate.TaskRecord {
	vc := string(v)
	return predicate.TaskRecord(sql.FieldEQ(FieldRole, vc))
}

// RoleNEQ applies the NEQ predicate on the "role" field.
func RoleNEQ(v consts.ChatRole) predicate.TaskRecord {
	vc := string(v)
	return predicate.TaskRecord(sql.FieldNEQ(FieldRole, vc))
}

// RoleIn applies the In predicate on the "role" field.
func RoleIn(vs ...consts.ChatRole) predicate.TaskRecord {
	v := make([]any, len(vs))
	for i := range v {
		v[i] = string(vs[i])
	}
	return predicate.TaskRecord(sql.FieldIn(FieldRole, v...))
}

// RoleNotIn applies the NotIn predicate on the "role" field.
func RoleNotIn(vs ...consts.ChatRole) predicate.TaskRecord {
	v := make([]any, len(vs))
	for i := range v {
		v[i] = string(vs[i])
	}
	return predicate.TaskRecord(sql.FieldNotIn(FieldRole, v...))
}

// RoleGT applies the GT predicate on the "role" field.
func RoleGT(v consts.ChatRole) predicate.TaskRecord {
	vc := string(v)
	return predicate.TaskRecord(sql.FieldGT(FieldRole, vc))
}

// RoleGTE applies the GTE predicate on the "role" field.
func RoleGTE(v consts.ChatRole) predicate.TaskRecord {
	vc := string(v)
	return predicate.TaskRecord(sql.FieldGTE(FieldRole, vc))
}

// RoleLT applies the LT predicate on the "role" field.
func RoleLT(v consts.ChatRole) predicate.TaskRecord {
	vc := string(v)
	return predicate.TaskRecord(sql.FieldLT(FieldRole, vc))
}

// RoleLTE applies the LTE predicate on the "role" field.
func RoleLTE(v consts.ChatRole) predicate.TaskRecord {
	vc := string(v)
	return predicate.TaskRecord(sql.FieldLTE(FieldRole, vc))
}

// RoleContains applies the Contains predicate on the "role" field.
func RoleContains(v consts.ChatRole) predicate.TaskRecord {
	vc := string(v)
	return predicate.TaskRecord(sql.FieldContains(FieldRole, vc))
}

// RoleHasPrefix applies the HasPrefix predicate on the "role" field.
func RoleHasPrefix(v consts.ChatRole) predicate.TaskRecord {
	vc := string(v)
	return predicate.TaskRecord(sql.FieldHasPrefix(FieldRole, vc))
}

// RoleHasSuffix applies the HasSuffix predicate on the "role" field.
func RoleHasSuffix(v consts.ChatRole) predicate.TaskRecord {
	vc := string(v)
	return predicate.TaskRecord(sql.FieldHasSuffix(FieldRole, vc))
}

// RoleEqualFold applies the EqualFold predicate on the "role" field.
func RoleEqualFold(v consts.ChatRole) predicate.TaskRecord {
	vc := string(v)
	return predicate.TaskRecord(sql.FieldEqualFold(FieldRole, vc))
}

// RoleContainsFold applies the ContainsFold predicate on the "role" field.
func RoleContainsFold(v consts.ChatRole) predicate.TaskRecord {
	vc := string(v)
	return predicate.TaskRecord(sql.FieldContainsFold(FieldRole, vc))
}

// CompletionEQ applies the EQ predicate on the "completion" field.
func CompletionEQ(v string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldEQ(FieldCompletion, v))
}

// CompletionNEQ applies the NEQ predicate on the "completion" field.
func CompletionNEQ(v string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldNEQ(FieldCompletion, v))
}

// CompletionIn applies the In predicate on the "completion" field.
func CompletionIn(vs ...string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldIn(FieldCompletion, vs...))
}

// CompletionNotIn applies the NotIn predicate on the "completion" field.
func CompletionNotIn(vs ...string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldNotIn(FieldCompletion, vs...))
}

// CompletionGT applies the GT predicate on the "completion" field.
func CompletionGT(v string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldGT(FieldCompletion, v))
}

// CompletionGTE applies the GTE predicate on the "completion" field.
func CompletionGTE(v string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldGTE(FieldCompletion, v))
}

// CompletionLT applies the LT predicate on the "completion" field.
func CompletionLT(v string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldLT(FieldCompletion, v))
}

// CompletionLTE applies the LTE predicate on the "completion" field.
func CompletionLTE(v string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldLTE(FieldCompletion, v))
}

// CompletionContains applies the Contains predicate on the "completion" field.
func CompletionContains(v string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldContains(FieldCompletion, v))
}

// CompletionHasPrefix applies the HasPrefix predicate on the "completion" field.
func CompletionHasPrefix(v string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldHasPrefix(FieldCompletion, v))
}

// CompletionHasSuffix applies the HasSuffix predicate on the "completion" field.
func CompletionHasSuffix(v string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldHasSuffix(FieldCompletion, v))
}

// CompletionEqualFold applies the EqualFold predicate on the "completion" field.
func CompletionEqualFold(v string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldEqualFold(FieldCompletion, v))
}

// CompletionContainsFold applies the ContainsFold predicate on the "completion" field.
func CompletionContainsFold(v string) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldContainsFold(FieldCompletion, v))
}

// OutputTokensEQ applies the EQ predicate on the "output_tokens" field.
func OutputTokensEQ(v int64) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldEQ(FieldOutputTokens, v))
}

// OutputTokensNEQ applies the NEQ predicate on the "output_tokens" field.
func OutputTokensNEQ(v int64) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldNEQ(FieldOutputTokens, v))
}

// OutputTokensIn applies the In predicate on the "output_tokens" field.
func OutputTokensIn(vs ...int64) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldIn(FieldOutputTokens, vs...))
}

// OutputTokensNotIn applies the NotIn predicate on the "output_tokens" field.
func OutputTokensNotIn(vs ...int64) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldNotIn(FieldOutputTokens, vs...))
}

// OutputTokensGT applies the GT predicate on the "output_tokens" field.
func OutputTokensGT(v int64) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldGT(FieldOutputTokens, v))
}

// OutputTokensGTE applies the GTE predicate on the "output_tokens" field.
func OutputTokensGTE(v int64) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldGTE(FieldOutputTokens, v))
}

// OutputTokensLT applies the LT predicate on the "output_tokens" field.
func OutputTokensLT(v int64) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldLT(FieldOutputTokens, v))
}

// OutputTokensLTE applies the LTE predicate on the "output_tokens" field.
func OutputTokensLTE(v int64) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldLTE(FieldOutputTokens, v))
}

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

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

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

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

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

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

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

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

// UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
func UpdatedAtEQ(v time.Time) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldEQ(FieldUpdatedAt, v))
}

// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
func UpdatedAtNEQ(v time.Time) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldNEQ(FieldUpdatedAt, v))
}

// UpdatedAtIn applies the In predicate on the "updated_at" field.
func UpdatedAtIn(vs ...time.Time) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldIn(FieldUpdatedAt, vs...))
}

// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
func UpdatedAtNotIn(vs ...time.Time) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldNotIn(FieldUpdatedAt, vs...))
}

// UpdatedAtGT applies the GT predicate on the "updated_at" field.
func UpdatedAtGT(v time.Time) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldGT(FieldUpdatedAt, v))
}

// UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
func UpdatedAtGTE(v time.Time) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldGTE(FieldUpdatedAt, v))
}

// UpdatedAtLT applies the LT predicate on the "updated_at" field.
func UpdatedAtLT(v time.Time) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldLT(FieldUpdatedAt, v))
}

// UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
func UpdatedAtLTE(v time.Time) predicate.TaskRecord {
	return predicate.TaskRecord(sql.FieldLTE(FieldUpdatedAt, v))
}

// HasTask applies the HasEdge predicate on the "task" edge.
func HasTask() predicate.TaskRecord {
	return predicate.TaskRecord(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.Edge(sqlgraph.M2O, true, TaskTable, TaskColumn),
		)
		sqlgraph.HasNeighbors(s, step)
	})
}

// HasTaskWith applies the HasEdge predicate on the "task" edge with a given conditions (other predicates).
func HasTaskWith(preds ...predicate.Task) predicate.TaskRecord {
	return predicate.TaskRecord(func(s *sql.Selector) {
		step := newTaskStep()
		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.TaskRecord) predicate.TaskRecord {
	return predicate.TaskRecord(sql.AndPredicates(predicates...))
}

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

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