188 lines
7.0 KiB
Go
188 lines
7.0 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package cloudflarer2
|
|
|
|
import (
|
|
"time"
|
|
|
|
"entgo.io/ent/dialect/sql"
|
|
"entgo.io/ent/dialect/sql/sqlgraph"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the cloudflarer2 type in the database.
|
|
Label = "cloudflare_r2"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldOwnerID holds the string denoting the owner_id field in the database.
|
|
FieldOwnerID = "owner_id"
|
|
// FieldName holds the string denoting the name field in the database.
|
|
FieldName = "name"
|
|
// FieldLocation holds the string denoting the location field in the database.
|
|
FieldLocation = "location"
|
|
// FieldStorageClass holds the string denoting the storage_class field in the database.
|
|
FieldStorageClass = "storage_class"
|
|
// FieldStatus holds the string denoting the status field in the database.
|
|
FieldStatus = "status"
|
|
// FieldPayloadSize holds the string denoting the payload_size field in the database.
|
|
FieldPayloadSize = "payload_size"
|
|
// FieldMetadataSize holds the string denoting the metadata_size field in the database.
|
|
FieldMetadataSize = "metadata_size"
|
|
// FieldObjectCount holds the string denoting the object_count field in the database.
|
|
FieldObjectCount = "object_count"
|
|
// FieldRemark holds the string denoting the remark field in the database.
|
|
FieldRemark = "remark"
|
|
// 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"
|
|
// EdgeCloudflareAccount holds the string denoting the cloudflare_account edge name in mutations.
|
|
EdgeCloudflareAccount = "cloudflare_account"
|
|
// Table holds the table name of the cloudflarer2 in the database.
|
|
Table = "cloudflare_r2s"
|
|
// CloudflareAccountTable is the table that holds the cloudflare_account relation/edge.
|
|
CloudflareAccountTable = "cloudflare_r2s"
|
|
// CloudflareAccountInverseTable is the table name for the CloudflareAccounts entity.
|
|
// It exists in this package in order to avoid circular dependency with the "cloudflareaccounts" package.
|
|
CloudflareAccountInverseTable = "cloudflare_accounts"
|
|
// CloudflareAccountColumn is the table column denoting the cloudflare_account relation/edge.
|
|
CloudflareAccountColumn = "cloudflare_accounts_cloudflare_buckets"
|
|
)
|
|
|
|
// Columns holds all SQL columns for cloudflarer2 fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldOwnerID,
|
|
FieldName,
|
|
FieldLocation,
|
|
FieldStorageClass,
|
|
FieldStatus,
|
|
FieldPayloadSize,
|
|
FieldMetadataSize,
|
|
FieldObjectCount,
|
|
FieldRemark,
|
|
FieldCreatedAt,
|
|
FieldUpdatedAt,
|
|
}
|
|
|
|
// ForeignKeys holds the SQL foreign-keys that are owned by the "cloudflare_r2s"
|
|
// table and are not defined as standalone fields in the schema.
|
|
var ForeignKeys = []string{
|
|
"cloudflare_accounts_cloudflare_buckets",
|
|
}
|
|
|
|
// 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
|
|
}
|
|
}
|
|
for i := range ForeignKeys {
|
|
if column == ForeignKeys[i] {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
var (
|
|
// NameValidator is a validator for the "name" field. It is called by the builders before save.
|
|
NameValidator func(string) error
|
|
// LocationValidator is a validator for the "location" field. It is called by the builders before save.
|
|
LocationValidator func(string) error
|
|
// StorageClassValidator is a validator for the "storage_class" field. It is called by the builders before save.
|
|
StorageClassValidator func(string) error
|
|
// DefaultStatus holds the default value on creation for the "status" field.
|
|
DefaultStatus int8
|
|
// DefaultPayloadSize holds the default value on creation for the "payload_size" field.
|
|
DefaultPayloadSize int64
|
|
// DefaultMetadataSize holds the default value on creation for the "metadata_size" field.
|
|
DefaultMetadataSize int64
|
|
// DefaultObjectCount holds the default value on creation for the "object_count" field.
|
|
DefaultObjectCount int
|
|
// 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
|
|
)
|
|
|
|
// OrderOption defines the ordering options for the CloudflareR2 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()
|
|
}
|
|
|
|
// ByOwnerID orders the results by the owner_id field.
|
|
func ByOwnerID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldOwnerID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByName orders the results by the name field.
|
|
func ByName(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldName, opts...).ToFunc()
|
|
}
|
|
|
|
// ByLocation orders the results by the location field.
|
|
func ByLocation(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldLocation, opts...).ToFunc()
|
|
}
|
|
|
|
// ByStorageClass orders the results by the storage_class field.
|
|
func ByStorageClass(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldStorageClass, opts...).ToFunc()
|
|
}
|
|
|
|
// ByStatus orders the results by the status field.
|
|
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldStatus, opts...).ToFunc()
|
|
}
|
|
|
|
// ByPayloadSize orders the results by the payload_size field.
|
|
func ByPayloadSize(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldPayloadSize, opts...).ToFunc()
|
|
}
|
|
|
|
// ByMetadataSize orders the results by the metadata_size field.
|
|
func ByMetadataSize(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldMetadataSize, opts...).ToFunc()
|
|
}
|
|
|
|
// ByObjectCount orders the results by the object_count field.
|
|
func ByObjectCount(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldObjectCount, opts...).ToFunc()
|
|
}
|
|
|
|
// ByRemark orders the results by the remark field.
|
|
func ByRemark(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldRemark, 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()
|
|
}
|
|
|
|
// ByCloudflareAccountField orders the results by cloudflare_account field.
|
|
func ByCloudflareAccountField(field string, opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newCloudflareAccountStep(), sql.OrderByField(field, opts...))
|
|
}
|
|
}
|
|
func newCloudflareAccountStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(CloudflareAccountInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.M2O, true, CloudflareAccountTable, CloudflareAccountColumn),
|
|
)
|
|
}
|