// Code generated by ent, DO NOT EDIT.

package errorpassthroughrule

import (
	"time"

	"entgo.io/ent/dialect/sql"
)

const (
	// Label holds the string label denoting the errorpassthroughrule type in the database.
	Label = "error_passthrough_rule"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldCreatedAt holds the string denoting the created_at field in the database.
	FieldCreatedAt = "created_at"
	// FieldUpdatedAt holds the string denoting the updated_at field in the database.
	FieldUpdatedAt = "updated_at"
	// FieldName holds the string denoting the name field in the database.
	FieldName = "name"
	// FieldEnabled holds the string denoting the enabled field in the database.
	FieldEnabled = "enabled"
	// FieldPriority holds the string denoting the priority field in the database.
	FieldPriority = "priority"
	// FieldErrorCodes holds the string denoting the error_codes field in the database.
	FieldErrorCodes = "error_codes"
	// FieldKeywords holds the string denoting the keywords field in the database.
	FieldKeywords = "keywords"
	// FieldMatchMode holds the string denoting the match_mode field in the database.
	FieldMatchMode = "match_mode"
	// FieldPlatforms holds the string denoting the platforms field in the database.
	FieldPlatforms = "platforms"
	// FieldPassthroughCode holds the string denoting the passthrough_code field in the database.
	FieldPassthroughCode = "passthrough_code"
	// FieldResponseCode holds the string denoting the response_code field in the database.
	FieldResponseCode = "response_code"
	// FieldPassthroughBody holds the string denoting the passthrough_body field in the database.
	FieldPassthroughBody = "passthrough_body"
	// FieldCustomMessage holds the string denoting the custom_message field in the database.
	FieldCustomMessage = "custom_message"
	// FieldSkipMonitoring holds the string denoting the skip_monitoring field in the database.
	FieldSkipMonitoring = "skip_monitoring"
	// FieldDescription holds the string denoting the description field in the database.
	FieldDescription = "description"
	// Table holds the table name of the errorpassthroughrule in the database.
	Table = "error_passthrough_rules"
)

// Columns holds all SQL columns for errorpassthroughrule fields.
var Columns = []string{
	FieldID,
	FieldCreatedAt,
	FieldUpdatedAt,
	FieldName,
	FieldEnabled,
	FieldPriority,
	FieldErrorCodes,
	FieldKeywords,
	FieldMatchMode,
	FieldPlatforms,
	FieldPassthroughCode,
	FieldResponseCode,
	FieldPassthroughBody,
	FieldCustomMessage,
	FieldSkipMonitoring,
	FieldDescription,
}

// ValidColumn reports if the column name is valid (part of the table columns).
func ValidColumn(column string) bool {
	for i := range Columns {
		if column == Columns[i] {
			return true
		}
	}
	return false
}

var (
	// DefaultCreatedAt holds the default value on creation for the "created_at" field.
	DefaultCreatedAt func() time.Time
	// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
	DefaultUpdatedAt func() time.Time
	// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
	UpdateDefaultUpdatedAt func() time.Time
	// NameValidator is a validator for the "name" field. It is called by the builders before save.
	NameValidator func(string) error
	// DefaultEnabled holds the default value on creation for the "enabled" field.
	DefaultEnabled bool
	// DefaultPriority holds the default value on creation for the "priority" field.
	DefaultPriority int
	// DefaultMatchMode holds the default value on creation for the "match_mode" field.
	DefaultMatchMode string
	// MatchModeValidator is a validator for the "match_mode" field. It is called by the builders before save.
	MatchModeValidator func(string) error
	// DefaultPassthroughCode holds the default value on creation for the "passthrough_code" field.
	DefaultPassthroughCode bool
	// DefaultPassthroughBody holds the default value on creation for the "passthrough_body" field.
	DefaultPassthroughBody bool
	// DefaultSkipMonitoring holds the default value on creation for the "skip_monitoring" field.
	DefaultSkipMonitoring bool
)

// OrderOption defines the ordering options for the ErrorPassthroughRule queries.
type OrderOption func(*sql.Selector)

// ByID orders the results by the id field.
func ByID(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldID, opts...).ToFunc()
}

// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}

// ByUpdatedAt orders the results by the updated_at field.
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
}

// ByName orders the results by the name field.
func ByName(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldName, opts...).ToFunc()
}

// ByEnabled orders the results by the enabled field.
func ByEnabled(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldEnabled, opts...).ToFunc()
}

// ByPriority orders the results by the priority field.
func ByPriority(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldPriority, opts...).ToFunc()
}

// ByMatchMode orders the results by the match_mode field.
func ByMatchMode(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldMatchMode, opts...).ToFunc()
}

// ByPassthroughCode orders the results by the passthrough_code field.
func ByPassthroughCode(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldPassthroughCode, opts...).ToFunc()
}

// ByResponseCode orders the results by the response_code field.
func ByResponseCode(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldResponseCode, opts...).ToFunc()
}

// ByPassthroughBody orders the results by the passthrough_body field.
func ByPassthroughBody(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldPassthroughBody, opts...).ToFunc()
}

// ByCustomMessage orders the results by the custom_message field.
func ByCustomMessage(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldCustomMessage, opts...).ToFunc()
}

// BySkipMonitoring orders the results by the skip_monitoring field.
func BySkipMonitoring(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldSkipMonitoring, opts...).ToFunc()
}

// ByDescription orders the results by the description field.
func ByDescription(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldDescription, opts...).ToFunc()
}
