openmeter / ent /db /appstripecustomer /appstripecustomer.go
Leon4gr45's picture
Upload folder using huggingface_hub (part 3)
1c4c66b verified
Raw
History Blame Contribute Delete
6.78 kB
// Code generated by ent, DO NOT EDIT.
package appstripecustomer
import (
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
)
const (
// Label holds the string label denoting the appstripecustomer type in the database.
Label = "app_stripe_customer"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldNamespace holds the string denoting the namespace field in the database.
FieldNamespace = "namespace"
// 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"
// FieldDeletedAt holds the string denoting the deleted_at field in the database.
FieldDeletedAt = "deleted_at"
// FieldAppID holds the string denoting the app_id field in the database.
FieldAppID = "app_id"
// FieldCustomerID holds the string denoting the customer_id field in the database.
FieldCustomerID = "customer_id"
// FieldStripeCustomerID holds the string denoting the stripe_customer_id field in the database.
FieldStripeCustomerID = "stripe_customer_id"
// FieldStripeDefaultPaymentMethodID holds the string denoting the stripe_default_payment_method_id field in the database.
FieldStripeDefaultPaymentMethodID = "stripe_default_payment_method_id"
// EdgeStripeApp holds the string denoting the stripe_app edge name in mutations.
EdgeStripeApp = "stripe_app"
// EdgeCustomer holds the string denoting the customer edge name in mutations.
EdgeCustomer = "customer"
// Table holds the table name of the appstripecustomer in the database.
Table = "app_stripe_customers"
// StripeAppTable is the table that holds the stripe_app relation/edge.
StripeAppTable = "app_stripe_customers"
// StripeAppInverseTable is the table name for the AppStripe entity.
// It exists in this package in order to avoid circular dependency with the "appstripe" package.
StripeAppInverseTable = "app_stripes"
// StripeAppColumn is the table column denoting the stripe_app relation/edge.
StripeAppColumn = "app_id"
// CustomerTable is the table that holds the customer relation/edge.
CustomerTable = "app_stripe_customers"
// CustomerInverseTable is the table name for the Customer entity.
// It exists in this package in order to avoid circular dependency with the "customer" package.
CustomerInverseTable = "customers"
// CustomerColumn is the table column denoting the customer relation/edge.
CustomerColumn = "customer_id"
)
// Columns holds all SQL columns for appstripecustomer fields.
var Columns = []string{
FieldID,
FieldNamespace,
FieldCreatedAt,
FieldUpdatedAt,
FieldDeletedAt,
FieldAppID,
FieldCustomerID,
FieldStripeCustomerID,
FieldStripeDefaultPaymentMethodID,
}
// 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 (
// NamespaceValidator is a validator for the "namespace" field. It is called by the builders before save.
NamespaceValidator func(string) error
// 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
// AppIDValidator is a validator for the "app_id" field. It is called by the builders before save.
AppIDValidator func(string) error
// CustomerIDValidator is a validator for the "customer_id" field. It is called by the builders before save.
CustomerIDValidator func(string) error
// StripeCustomerIDValidator is a validator for the "stripe_customer_id" field. It is called by the builders before save.
StripeCustomerIDValidator func(string) error
)
// OrderOption defines the ordering options for the AppStripeCustomer 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()
}
// ByNamespace orders the results by the namespace field.
func ByNamespace(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldNamespace, 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()
}
// ByDeletedAt orders the results by the deleted_at field.
func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
}
// ByAppID orders the results by the app_id field.
func ByAppID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldAppID, opts...).ToFunc()
}
// ByCustomerID orders the results by the customer_id field.
func ByCustomerID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCustomerID, opts...).ToFunc()
}
// ByStripeCustomerID orders the results by the stripe_customer_id field.
func ByStripeCustomerID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStripeCustomerID, opts...).ToFunc()
}
// ByStripeDefaultPaymentMethodID orders the results by the stripe_default_payment_method_id field.
func ByStripeDefaultPaymentMethodID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStripeDefaultPaymentMethodID, opts...).ToFunc()
}
// ByStripeAppField orders the results by stripe_app field.
func ByStripeAppField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newStripeAppStep(), sql.OrderByField(field, opts...))
}
}
// ByCustomerField orders the results by customer field.
func ByCustomerField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newCustomerStep(), sql.OrderByField(field, opts...))
}
}
func newStripeAppStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(StripeAppInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, StripeAppTable, StripeAppColumn),
)
}
func newCustomerStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(CustomerInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, false, CustomerTable, CustomerColumn),
)
}