ent

package
v0.0.0-...-9d82fa0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Operation types.
	OpCreate    = ent.OpCreate
	OpDelete    = ent.OpDelete
	OpDeleteOne = ent.OpDeleteOne
	OpUpdate    = ent.OpUpdate
	OpUpdateOne = ent.OpUpdateOne

	// Node types.
	TypeChatBan         = "ChatBan"
	TypeChatMessage     = "ChatMessage"
	TypeChatRoom        = "ChatRoom"
	TypePasswordToken   = "PasswordToken"
	TypePaymentCustomer = "PaymentCustomer"
	TypePaymentIntent   = "PaymentIntent"
	TypePaymentMethod   = "PaymentMethod"
	TypeSubscription    = "Subscription"
	TypeUser            = "User"
)

Variables

View Source
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")

ErrTxStarted is returned when trying to start a new transaction from a transactional client.

Functions

func Asc

func Asc(fields ...string) func(*sql.Selector)

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) func(*sql.Selector)

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

IsConstraintError returns a boolean indicating whether the error is a constraint failure.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns a boolean indicating whether the error is a not found error.

func IsNotLoaded

func IsNotLoaded(err error) bool

IsNotLoaded returns a boolean indicating whether the error is a not loaded error.

func IsNotSingular

func IsNotSingular(err error) bool

IsNotSingular returns a boolean indicating whether the error is a not singular error.

func IsValidationError

func IsValidationError(err error) bool

IsValidationError returns a boolean indicating whether the error is a validation error.

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

func NewContext(parent context.Context, c *Client) context.Context

NewContext returns a new context with the given Client attached.

func NewTxContext

func NewTxContext(parent context.Context, tx *Tx) context.Context

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

AggregateFunc applies an aggregation step on the group-by traversal/selector.

func As

As is a pseudo aggregation function for renaming another other functions with custom names. For example:

GroupBy(field1, field2).
Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")).
Scan(ctx, &v)

func Count

func Count() AggregateFunc

Count applies the "count" aggregation function on each group.

func Max

func Max(field string) AggregateFunc

Max applies the "max" aggregation function on the given field of each group.

func Mean

func Mean(field string) AggregateFunc

Mean applies the "mean" aggregation function on the given field of each group.

func Min

func Min(field string) AggregateFunc

Min applies the "min" aggregation function on the given field of each group.

func Sum

func Sum(field string) AggregateFunc

Sum applies the "sum" aggregation function on the given field of each group.

type ChatBan

type ChatBan struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// IPHash holds the value of the "ip_hash" field.
	IPHash string `json:"ip_hash,omitempty"`
	// Reason holds the value of the "reason" field.
	Reason string `json:"reason,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ChatBanQuery when eager-loading is set.
	Edges ChatBanEdges `json:"edges"`
	// contains filtered or unexported fields
}

ChatBan is the model entity for the ChatBan schema.

func (*ChatBan) QueryBannedByUser

func (_m *ChatBan) QueryBannedByUser() *UserQuery

QueryBannedByUser queries the "banned_by_user" edge of the ChatBan entity.

func (*ChatBan) QueryRoom

func (_m *ChatBan) QueryRoom() *ChatRoomQuery

QueryRoom queries the "room" edge of the ChatBan entity.

func (*ChatBan) QueryUser

func (_m *ChatBan) QueryUser() *UserQuery

QueryUser queries the "user" edge of the ChatBan entity.

func (*ChatBan) String

func (_m *ChatBan) String() string

String implements the fmt.Stringer.

func (*ChatBan) Unwrap

func (_m *ChatBan) Unwrap() *ChatBan

Unwrap unwraps the ChatBan entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*ChatBan) Update

func (_m *ChatBan) Update() *ChatBanUpdateOne

Update returns a builder for updating this ChatBan. Note that you need to call ChatBan.Unwrap() before calling this method if this ChatBan was returned from a transaction, and the transaction was committed or rolled back.

func (*ChatBan) Value

func (_m *ChatBan) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the ChatBan. This includes values selected through modifiers, order, etc.

type ChatBanClient

type ChatBanClient struct {
	// contains filtered or unexported fields
}

ChatBanClient is a client for the ChatBan schema.

func NewChatBanClient

func NewChatBanClient(c config) *ChatBanClient

NewChatBanClient returns a client for the ChatBan from the given config.

func (*ChatBanClient) Create

func (c *ChatBanClient) Create() *ChatBanCreate

Create returns a builder for creating a ChatBan entity.

func (*ChatBanClient) CreateBulk

func (c *ChatBanClient) CreateBulk(builders ...*ChatBanCreate) *ChatBanCreateBulk

CreateBulk returns a builder for creating a bulk of ChatBan entities.

func (*ChatBanClient) Delete

func (c *ChatBanClient) Delete() *ChatBanDelete

Delete returns a delete builder for ChatBan.

func (*ChatBanClient) DeleteOne

func (c *ChatBanClient) DeleteOne(_m *ChatBan) *ChatBanDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ChatBanClient) DeleteOneID

func (c *ChatBanClient) DeleteOneID(id int) *ChatBanDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ChatBanClient) Get

func (c *ChatBanClient) Get(ctx context.Context, id int) (*ChatBan, error)

Get returns a ChatBan entity by its id.

func (*ChatBanClient) GetX

func (c *ChatBanClient) GetX(ctx context.Context, id int) *ChatBan

GetX is like Get, but panics if an error occurs.

func (*ChatBanClient) Hooks

func (c *ChatBanClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ChatBanClient) Intercept

func (c *ChatBanClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `chatban.Intercept(f(g(h())))`.

func (*ChatBanClient) Interceptors

func (c *ChatBanClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ChatBanClient) MapCreateBulk

func (c *ChatBanClient) MapCreateBulk(slice any, setFunc func(*ChatBanCreate, int)) *ChatBanCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*ChatBanClient) Query

func (c *ChatBanClient) Query() *ChatBanQuery

Query returns a query builder for ChatBan.

func (*ChatBanClient) QueryBannedByUser

func (c *ChatBanClient) QueryBannedByUser(_m *ChatBan) *UserQuery

QueryBannedByUser queries the banned_by_user edge of a ChatBan.

func (*ChatBanClient) QueryRoom

func (c *ChatBanClient) QueryRoom(_m *ChatBan) *ChatRoomQuery

QueryRoom queries the room edge of a ChatBan.

func (*ChatBanClient) QueryUser

func (c *ChatBanClient) QueryUser(_m *ChatBan) *UserQuery

QueryUser queries the user edge of a ChatBan.

func (*ChatBanClient) Update

func (c *ChatBanClient) Update() *ChatBanUpdate

Update returns an update builder for ChatBan.

func (*ChatBanClient) UpdateOne

func (c *ChatBanClient) UpdateOne(_m *ChatBan) *ChatBanUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ChatBanClient) UpdateOneID

func (c *ChatBanClient) UpdateOneID(id int) *ChatBanUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ChatBanClient) Use

func (c *ChatBanClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `chatban.Hooks(f(g(h())))`.

type ChatBanCreate

type ChatBanCreate struct {
	// contains filtered or unexported fields
}

ChatBanCreate is the builder for creating a ChatBan entity.

func (*ChatBanCreate) Exec

func (_c *ChatBanCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ChatBanCreate) ExecX

func (_c *ChatBanCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChatBanCreate) Mutation

func (_c *ChatBanCreate) Mutation() *ChatBanMutation

Mutation returns the ChatBanMutation object of the builder.

func (*ChatBanCreate) Save

func (_c *ChatBanCreate) Save(ctx context.Context) (*ChatBan, error)

Save creates the ChatBan in the database.

func (*ChatBanCreate) SaveX

func (_c *ChatBanCreate) SaveX(ctx context.Context) *ChatBan

SaveX calls Save and panics if Save returns an error.

func (*ChatBanCreate) SetBannedByUser

func (_c *ChatBanCreate) SetBannedByUser(v *User) *ChatBanCreate

SetBannedByUser sets the "banned_by_user" edge to the User entity.

func (*ChatBanCreate) SetBannedByUserID

func (_c *ChatBanCreate) SetBannedByUserID(id int) *ChatBanCreate

SetBannedByUserID sets the "banned_by_user" edge to the User entity by ID.

func (*ChatBanCreate) SetCreatedAt

func (_c *ChatBanCreate) SetCreatedAt(v time.Time) *ChatBanCreate

SetCreatedAt sets the "created_at" field.

func (*ChatBanCreate) SetIPHash

func (_c *ChatBanCreate) SetIPHash(v string) *ChatBanCreate

SetIPHash sets the "ip_hash" field.

func (*ChatBanCreate) SetNillableCreatedAt

func (_c *ChatBanCreate) SetNillableCreatedAt(v *time.Time) *ChatBanCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ChatBanCreate) SetNillableIPHash

func (_c *ChatBanCreate) SetNillableIPHash(v *string) *ChatBanCreate

SetNillableIPHash sets the "ip_hash" field if the given value is not nil.

func (*ChatBanCreate) SetNillableReason

func (_c *ChatBanCreate) SetNillableReason(v *string) *ChatBanCreate

SetNillableReason sets the "reason" field if the given value is not nil.

func (*ChatBanCreate) SetNillableUserID

func (_c *ChatBanCreate) SetNillableUserID(id *int) *ChatBanCreate

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*ChatBanCreate) SetReason

func (_c *ChatBanCreate) SetReason(v string) *ChatBanCreate

SetReason sets the "reason" field.

func (*ChatBanCreate) SetRoom

func (_c *ChatBanCreate) SetRoom(v *ChatRoom) *ChatBanCreate

SetRoom sets the "room" edge to the ChatRoom entity.

func (*ChatBanCreate) SetRoomID

func (_c *ChatBanCreate) SetRoomID(id int) *ChatBanCreate

SetRoomID sets the "room" edge to the ChatRoom entity by ID.

func (*ChatBanCreate) SetUser

func (_c *ChatBanCreate) SetUser(v *User) *ChatBanCreate

SetUser sets the "user" edge to the User entity.

func (*ChatBanCreate) SetUserID

func (_c *ChatBanCreate) SetUserID(id int) *ChatBanCreate

SetUserID sets the "user" edge to the User entity by ID.

type ChatBanCreateBulk

type ChatBanCreateBulk struct {
	// contains filtered or unexported fields
}

ChatBanCreateBulk is the builder for creating many ChatBan entities in bulk.

func (*ChatBanCreateBulk) Exec

func (_c *ChatBanCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ChatBanCreateBulk) ExecX

func (_c *ChatBanCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChatBanCreateBulk) Save

func (_c *ChatBanCreateBulk) Save(ctx context.Context) ([]*ChatBan, error)

Save creates the ChatBan entities in the database.

func (*ChatBanCreateBulk) SaveX

func (_c *ChatBanCreateBulk) SaveX(ctx context.Context) []*ChatBan

SaveX is like Save, but panics if an error occurs.

type ChatBanDelete

type ChatBanDelete struct {
	// contains filtered or unexported fields
}

ChatBanDelete is the builder for deleting a ChatBan entity.

func (*ChatBanDelete) Exec

func (_d *ChatBanDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ChatBanDelete) ExecX

func (_d *ChatBanDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ChatBanDelete) Where

func (_d *ChatBanDelete) Where(ps ...predicate.ChatBan) *ChatBanDelete

Where appends a list predicates to the ChatBanDelete builder.

type ChatBanDeleteOne

type ChatBanDeleteOne struct {
	// contains filtered or unexported fields
}

ChatBanDeleteOne is the builder for deleting a single ChatBan entity.

func (*ChatBanDeleteOne) Exec

func (_d *ChatBanDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ChatBanDeleteOne) ExecX

func (_d *ChatBanDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChatBanDeleteOne) Where

Where appends a list predicates to the ChatBanDelete builder.

type ChatBanEdges

type ChatBanEdges struct {
	// Room holds the value of the room edge.
	Room *ChatRoom `json:"room,omitempty"`
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// BannedByUser holds the value of the banned_by_user edge.
	BannedByUser *User `json:"banned_by_user,omitempty"`
	// contains filtered or unexported fields
}

ChatBanEdges holds the relations/edges for other nodes in the graph.

func (ChatBanEdges) BannedByUserOrErr

func (e ChatBanEdges) BannedByUserOrErr() (*User, error)

BannedByUserOrErr returns the BannedByUser value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ChatBanEdges) RoomOrErr

func (e ChatBanEdges) RoomOrErr() (*ChatRoom, error)

RoomOrErr returns the Room value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ChatBanEdges) UserOrErr

func (e ChatBanEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ChatBanGroupBy

type ChatBanGroupBy struct {
	// contains filtered or unexported fields
}

ChatBanGroupBy is the group-by builder for ChatBan entities.

func (*ChatBanGroupBy) Aggregate

func (_g *ChatBanGroupBy) Aggregate(fns ...AggregateFunc) *ChatBanGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ChatBanGroupBy) Bool

func (s *ChatBanGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ChatBanGroupBy) BoolX

func (s *ChatBanGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ChatBanGroupBy) Bools

func (s *ChatBanGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ChatBanGroupBy) BoolsX

func (s *ChatBanGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ChatBanGroupBy) Float64

func (s *ChatBanGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ChatBanGroupBy) Float64X

func (s *ChatBanGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ChatBanGroupBy) Float64s

func (s *ChatBanGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ChatBanGroupBy) Float64sX

func (s *ChatBanGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ChatBanGroupBy) Int

func (s *ChatBanGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ChatBanGroupBy) IntX

func (s *ChatBanGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ChatBanGroupBy) Ints

func (s *ChatBanGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ChatBanGroupBy) IntsX

func (s *ChatBanGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ChatBanGroupBy) Scan

func (_g *ChatBanGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ChatBanGroupBy) ScanX

func (s *ChatBanGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ChatBanGroupBy) String

func (s *ChatBanGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ChatBanGroupBy) StringX

func (s *ChatBanGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ChatBanGroupBy) Strings

func (s *ChatBanGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ChatBanGroupBy) StringsX

func (s *ChatBanGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ChatBanMutation

type ChatBanMutation struct {
	// contains filtered or unexported fields
}

ChatBanMutation represents an operation that mutates the ChatBan nodes in the graph.

func (*ChatBanMutation) AddField

func (m *ChatBanMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ChatBanMutation) AddedEdges

func (m *ChatBanMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ChatBanMutation) AddedField

func (m *ChatBanMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ChatBanMutation) AddedFields

func (m *ChatBanMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ChatBanMutation) AddedIDs

func (m *ChatBanMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ChatBanMutation) BannedByUserCleared

func (m *ChatBanMutation) BannedByUserCleared() bool

BannedByUserCleared reports if the "banned_by_user" edge to the User entity was cleared.

func (*ChatBanMutation) BannedByUserID

func (m *ChatBanMutation) BannedByUserID() (id int, exists bool)

BannedByUserID returns the "banned_by_user" edge ID in the mutation.

func (*ChatBanMutation) BannedByUserIDs

func (m *ChatBanMutation) BannedByUserIDs() (ids []int)

BannedByUserIDs returns the "banned_by_user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use BannedByUserID instead. It exists only for internal usage by the builders.

func (*ChatBanMutation) ClearBannedByUser

func (m *ChatBanMutation) ClearBannedByUser()

ClearBannedByUser clears the "banned_by_user" edge to the User entity.

func (*ChatBanMutation) ClearEdge

func (m *ChatBanMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*ChatBanMutation) ClearField

func (m *ChatBanMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*ChatBanMutation) ClearIPHash

func (m *ChatBanMutation) ClearIPHash()

ClearIPHash clears the value of the "ip_hash" field.

func (*ChatBanMutation) ClearReason

func (m *ChatBanMutation) ClearReason()

ClearReason clears the value of the "reason" field.

func (*ChatBanMutation) ClearRoom

func (m *ChatBanMutation) ClearRoom()

ClearRoom clears the "room" edge to the ChatRoom entity.

func (*ChatBanMutation) ClearUser

func (m *ChatBanMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*ChatBanMutation) ClearedEdges

func (m *ChatBanMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ChatBanMutation) ClearedFields

func (m *ChatBanMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ChatBanMutation) Client

func (m ChatBanMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*ChatBanMutation) CreatedAt

func (m *ChatBanMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ChatBanMutation) EdgeCleared

func (m *ChatBanMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ChatBanMutation) Field

func (m *ChatBanMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ChatBanMutation) FieldCleared

func (m *ChatBanMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ChatBanMutation) Fields

func (m *ChatBanMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*ChatBanMutation) ID

func (m *ChatBanMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*ChatBanMutation) IDs

func (m *ChatBanMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ChatBanMutation) IPHash

func (m *ChatBanMutation) IPHash() (r string, exists bool)

IPHash returns the value of the "ip_hash" field in the mutation.

func (*ChatBanMutation) IPHashCleared

func (m *ChatBanMutation) IPHashCleared() bool

IPHashCleared returns if the "ip_hash" field was cleared in this mutation.

func (*ChatBanMutation) OldCreatedAt

func (m *ChatBanMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the ChatBan entity. If the ChatBan object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ChatBanMutation) OldField

func (m *ChatBanMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*ChatBanMutation) OldIPHash

func (m *ChatBanMutation) OldIPHash(ctx context.Context) (v string, err error)

OldIPHash returns the old "ip_hash" field's value of the ChatBan entity. If the ChatBan object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ChatBanMutation) OldReason

func (m *ChatBanMutation) OldReason(ctx context.Context) (v string, err error)

OldReason returns the old "reason" field's value of the ChatBan entity. If the ChatBan object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ChatBanMutation) Op

func (m *ChatBanMutation) Op() Op

Op returns the operation name.

func (*ChatBanMutation) Reason

func (m *ChatBanMutation) Reason() (r string, exists bool)

Reason returns the value of the "reason" field in the mutation.

func (*ChatBanMutation) ReasonCleared

func (m *ChatBanMutation) ReasonCleared() bool

ReasonCleared returns if the "reason" field was cleared in this mutation.

func (*ChatBanMutation) RemovedEdges

func (m *ChatBanMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ChatBanMutation) RemovedIDs

func (m *ChatBanMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*ChatBanMutation) ResetBannedByUser

func (m *ChatBanMutation) ResetBannedByUser()

ResetBannedByUser resets all changes to the "banned_by_user" edge.

func (*ChatBanMutation) ResetCreatedAt

func (m *ChatBanMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ChatBanMutation) ResetEdge

func (m *ChatBanMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*ChatBanMutation) ResetField

func (m *ChatBanMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*ChatBanMutation) ResetIPHash

func (m *ChatBanMutation) ResetIPHash()

ResetIPHash resets all changes to the "ip_hash" field.

func (*ChatBanMutation) ResetReason

func (m *ChatBanMutation) ResetReason()

ResetReason resets all changes to the "reason" field.

func (*ChatBanMutation) ResetRoom

func (m *ChatBanMutation) ResetRoom()

ResetRoom resets all changes to the "room" edge.

func (*ChatBanMutation) ResetUser

func (m *ChatBanMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*ChatBanMutation) RoomCleared

func (m *ChatBanMutation) RoomCleared() bool

RoomCleared reports if the "room" edge to the ChatRoom entity was cleared.

func (*ChatBanMutation) RoomID

func (m *ChatBanMutation) RoomID() (id int, exists bool)

RoomID returns the "room" edge ID in the mutation.

func (*ChatBanMutation) RoomIDs

func (m *ChatBanMutation) RoomIDs() (ids []int)

RoomIDs returns the "room" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use RoomID instead. It exists only for internal usage by the builders.

func (*ChatBanMutation) SetBannedByUserID

func (m *ChatBanMutation) SetBannedByUserID(id int)

SetBannedByUserID sets the "banned_by_user" edge to the User entity by id.

func (*ChatBanMutation) SetCreatedAt

func (m *ChatBanMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ChatBanMutation) SetField

func (m *ChatBanMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ChatBanMutation) SetIPHash

func (m *ChatBanMutation) SetIPHash(s string)

SetIPHash sets the "ip_hash" field.

func (*ChatBanMutation) SetOp

func (m *ChatBanMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ChatBanMutation) SetReason

func (m *ChatBanMutation) SetReason(s string)

SetReason sets the "reason" field.

func (*ChatBanMutation) SetRoomID

func (m *ChatBanMutation) SetRoomID(id int)

SetRoomID sets the "room" edge to the ChatRoom entity by id.

func (*ChatBanMutation) SetUserID

func (m *ChatBanMutation) SetUserID(id int)

SetUserID sets the "user" edge to the User entity by id.

func (ChatBanMutation) Tx

func (m ChatBanMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ChatBanMutation) Type

func (m *ChatBanMutation) Type() string

Type returns the node type of this mutation (ChatBan).

func (*ChatBanMutation) UserCleared

func (m *ChatBanMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*ChatBanMutation) UserID

func (m *ChatBanMutation) UserID() (id int, exists bool)

UserID returns the "user" edge ID in the mutation.

func (*ChatBanMutation) UserIDs

func (m *ChatBanMutation) UserIDs() (ids []int)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*ChatBanMutation) Where

func (m *ChatBanMutation) Where(ps ...predicate.ChatBan)

Where appends a list predicates to the ChatBanMutation builder.

func (*ChatBanMutation) WhereP

func (m *ChatBanMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ChatBanMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ChatBanQuery

type ChatBanQuery struct {
	// contains filtered or unexported fields
}

ChatBanQuery is the builder for querying ChatBan entities.

func (*ChatBanQuery) Aggregate

func (_q *ChatBanQuery) Aggregate(fns ...AggregateFunc) *ChatBanSelect

Aggregate returns a ChatBanSelect configured with the given aggregations.

func (*ChatBanQuery) All

func (_q *ChatBanQuery) All(ctx context.Context) ([]*ChatBan, error)

All executes the query and returns a list of ChatBans.

func (*ChatBanQuery) AllX

func (_q *ChatBanQuery) AllX(ctx context.Context) []*ChatBan

AllX is like All, but panics if an error occurs.

func (*ChatBanQuery) Clone

func (_q *ChatBanQuery) Clone() *ChatBanQuery

Clone returns a duplicate of the ChatBanQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ChatBanQuery) Count

func (_q *ChatBanQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ChatBanQuery) CountX

func (_q *ChatBanQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ChatBanQuery) Exist

func (_q *ChatBanQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ChatBanQuery) ExistX

func (_q *ChatBanQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ChatBanQuery) First

func (_q *ChatBanQuery) First(ctx context.Context) (*ChatBan, error)

First returns the first ChatBan entity from the query. Returns a *NotFoundError when no ChatBan was found.

func (*ChatBanQuery) FirstID

func (_q *ChatBanQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first ChatBan ID from the query. Returns a *NotFoundError when no ChatBan ID was found.

func (*ChatBanQuery) FirstIDX

func (_q *ChatBanQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*ChatBanQuery) FirstX

func (_q *ChatBanQuery) FirstX(ctx context.Context) *ChatBan

FirstX is like First, but panics if an error occurs.

func (*ChatBanQuery) GroupBy

func (_q *ChatBanQuery) GroupBy(field string, fields ...string) *ChatBanGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	IPHash string `json:"ip_hash,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ChatBan.Query().
	GroupBy(chatban.FieldIPHash).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ChatBanQuery) IDs

func (_q *ChatBanQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of ChatBan IDs.

func (*ChatBanQuery) IDsX

func (_q *ChatBanQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*ChatBanQuery) Limit

func (_q *ChatBanQuery) Limit(limit int) *ChatBanQuery

Limit the number of records to be returned by this query.

func (*ChatBanQuery) Offset

func (_q *ChatBanQuery) Offset(offset int) *ChatBanQuery

Offset to start from.

func (*ChatBanQuery) Only

func (_q *ChatBanQuery) Only(ctx context.Context) (*ChatBan, error)

Only returns a single ChatBan entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ChatBan entity is found. Returns a *NotFoundError when no ChatBan entities are found.

func (*ChatBanQuery) OnlyID

func (_q *ChatBanQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only ChatBan ID in the query. Returns a *NotSingularError when more than one ChatBan ID is found. Returns a *NotFoundError when no entities are found.

func (*ChatBanQuery) OnlyIDX

func (_q *ChatBanQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ChatBanQuery) OnlyX

func (_q *ChatBanQuery) OnlyX(ctx context.Context) *ChatBan

OnlyX is like Only, but panics if an error occurs.

func (*ChatBanQuery) Order

func (_q *ChatBanQuery) Order(o ...chatban.OrderOption) *ChatBanQuery

Order specifies how the records should be ordered.

func (*ChatBanQuery) QueryBannedByUser

func (_q *ChatBanQuery) QueryBannedByUser() *UserQuery

QueryBannedByUser chains the current query on the "banned_by_user" edge.

func (*ChatBanQuery) QueryRoom

func (_q *ChatBanQuery) QueryRoom() *ChatRoomQuery

QueryRoom chains the current query on the "room" edge.

func (*ChatBanQuery) QueryUser

func (_q *ChatBanQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*ChatBanQuery) Select

func (_q *ChatBanQuery) Select(fields ...string) *ChatBanSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	IPHash string `json:"ip_hash,omitempty"`
}

client.ChatBan.Query().
	Select(chatban.FieldIPHash).
	Scan(ctx, &v)

func (*ChatBanQuery) Unique

func (_q *ChatBanQuery) Unique(unique bool) *ChatBanQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*ChatBanQuery) Where

func (_q *ChatBanQuery) Where(ps ...predicate.ChatBan) *ChatBanQuery

Where adds a new predicate for the ChatBanQuery builder.

func (*ChatBanQuery) WithBannedByUser

func (_q *ChatBanQuery) WithBannedByUser(opts ...func(*UserQuery)) *ChatBanQuery

WithBannedByUser tells the query-builder to eager-load the nodes that are connected to the "banned_by_user" edge. The optional arguments are used to configure the query builder of the edge.

func (*ChatBanQuery) WithRoom

func (_q *ChatBanQuery) WithRoom(opts ...func(*ChatRoomQuery)) *ChatBanQuery

WithRoom tells the query-builder to eager-load the nodes that are connected to the "room" edge. The optional arguments are used to configure the query builder of the edge.

func (*ChatBanQuery) WithUser

func (_q *ChatBanQuery) WithUser(opts ...func(*UserQuery)) *ChatBanQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type ChatBanSelect

type ChatBanSelect struct {
	*ChatBanQuery
	// contains filtered or unexported fields
}

ChatBanSelect is the builder for selecting fields of ChatBan entities.

func (*ChatBanSelect) Aggregate

func (_s *ChatBanSelect) Aggregate(fns ...AggregateFunc) *ChatBanSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ChatBanSelect) Bool

func (s *ChatBanSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ChatBanSelect) BoolX

func (s *ChatBanSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ChatBanSelect) Bools

func (s *ChatBanSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ChatBanSelect) BoolsX

func (s *ChatBanSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ChatBanSelect) Float64

func (s *ChatBanSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ChatBanSelect) Float64X

func (s *ChatBanSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ChatBanSelect) Float64s

func (s *ChatBanSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ChatBanSelect) Float64sX

func (s *ChatBanSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ChatBanSelect) Int

func (s *ChatBanSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ChatBanSelect) IntX

func (s *ChatBanSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ChatBanSelect) Ints

func (s *ChatBanSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ChatBanSelect) IntsX

func (s *ChatBanSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ChatBanSelect) Scan

func (_s *ChatBanSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ChatBanSelect) ScanX

func (s *ChatBanSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ChatBanSelect) String

func (s *ChatBanSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ChatBanSelect) StringX

func (s *ChatBanSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ChatBanSelect) Strings

func (s *ChatBanSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ChatBanSelect) StringsX

func (s *ChatBanSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ChatBanUpdate

type ChatBanUpdate struct {
	// contains filtered or unexported fields
}

ChatBanUpdate is the builder for updating ChatBan entities.

func (*ChatBanUpdate) ClearBannedByUser

func (_u *ChatBanUpdate) ClearBannedByUser() *ChatBanUpdate

ClearBannedByUser clears the "banned_by_user" edge to the User entity.

func (*ChatBanUpdate) ClearIPHash

func (_u *ChatBanUpdate) ClearIPHash() *ChatBanUpdate

ClearIPHash clears the value of the "ip_hash" field.

func (*ChatBanUpdate) ClearReason

func (_u *ChatBanUpdate) ClearReason() *ChatBanUpdate

ClearReason clears the value of the "reason" field.

func (*ChatBanUpdate) ClearRoom

func (_u *ChatBanUpdate) ClearRoom() *ChatBanUpdate

ClearRoom clears the "room" edge to the ChatRoom entity.

func (*ChatBanUpdate) ClearUser

func (_u *ChatBanUpdate) ClearUser() *ChatBanUpdate

ClearUser clears the "user" edge to the User entity.

func (*ChatBanUpdate) Exec

func (_u *ChatBanUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ChatBanUpdate) ExecX

func (_u *ChatBanUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChatBanUpdate) Mutation

func (_u *ChatBanUpdate) Mutation() *ChatBanMutation

Mutation returns the ChatBanMutation object of the builder.

func (*ChatBanUpdate) Save

func (_u *ChatBanUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ChatBanUpdate) SaveX

func (_u *ChatBanUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ChatBanUpdate) SetBannedByUser

func (_u *ChatBanUpdate) SetBannedByUser(v *User) *ChatBanUpdate

SetBannedByUser sets the "banned_by_user" edge to the User entity.

func (*ChatBanUpdate) SetBannedByUserID

func (_u *ChatBanUpdate) SetBannedByUserID(id int) *ChatBanUpdate

SetBannedByUserID sets the "banned_by_user" edge to the User entity by ID.

func (*ChatBanUpdate) SetIPHash

func (_u *ChatBanUpdate) SetIPHash(v string) *ChatBanUpdate

SetIPHash sets the "ip_hash" field.

func (*ChatBanUpdate) SetNillableIPHash

func (_u *ChatBanUpdate) SetNillableIPHash(v *string) *ChatBanUpdate

SetNillableIPHash sets the "ip_hash" field if the given value is not nil.

func (*ChatBanUpdate) SetNillableReason

func (_u *ChatBanUpdate) SetNillableReason(v *string) *ChatBanUpdate

SetNillableReason sets the "reason" field if the given value is not nil.

func (*ChatBanUpdate) SetNillableUserID

func (_u *ChatBanUpdate) SetNillableUserID(id *int) *ChatBanUpdate

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*ChatBanUpdate) SetReason

func (_u *ChatBanUpdate) SetReason(v string) *ChatBanUpdate

SetReason sets the "reason" field.

func (*ChatBanUpdate) SetRoom

func (_u *ChatBanUpdate) SetRoom(v *ChatRoom) *ChatBanUpdate

SetRoom sets the "room" edge to the ChatRoom entity.

func (*ChatBanUpdate) SetRoomID

func (_u *ChatBanUpdate) SetRoomID(id int) *ChatBanUpdate

SetRoomID sets the "room" edge to the ChatRoom entity by ID.

func (*ChatBanUpdate) SetUser

func (_u *ChatBanUpdate) SetUser(v *User) *ChatBanUpdate

SetUser sets the "user" edge to the User entity.

func (*ChatBanUpdate) SetUserID

func (_u *ChatBanUpdate) SetUserID(id int) *ChatBanUpdate

SetUserID sets the "user" edge to the User entity by ID.

func (*ChatBanUpdate) Where

func (_u *ChatBanUpdate) Where(ps ...predicate.ChatBan) *ChatBanUpdate

Where appends a list predicates to the ChatBanUpdate builder.

type ChatBanUpdateOne

type ChatBanUpdateOne struct {
	// contains filtered or unexported fields
}

ChatBanUpdateOne is the builder for updating a single ChatBan entity.

func (*ChatBanUpdateOne) ClearBannedByUser

func (_u *ChatBanUpdateOne) ClearBannedByUser() *ChatBanUpdateOne

ClearBannedByUser clears the "banned_by_user" edge to the User entity.

func (*ChatBanUpdateOne) ClearIPHash

func (_u *ChatBanUpdateOne) ClearIPHash() *ChatBanUpdateOne

ClearIPHash clears the value of the "ip_hash" field.

func (*ChatBanUpdateOne) ClearReason

func (_u *ChatBanUpdateOne) ClearReason() *ChatBanUpdateOne

ClearReason clears the value of the "reason" field.

func (*ChatBanUpdateOne) ClearRoom

func (_u *ChatBanUpdateOne) ClearRoom() *ChatBanUpdateOne

ClearRoom clears the "room" edge to the ChatRoom entity.

func (*ChatBanUpdateOne) ClearUser

func (_u *ChatBanUpdateOne) ClearUser() *ChatBanUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*ChatBanUpdateOne) Exec

func (_u *ChatBanUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ChatBanUpdateOne) ExecX

func (_u *ChatBanUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChatBanUpdateOne) Mutation

func (_u *ChatBanUpdateOne) Mutation() *ChatBanMutation

Mutation returns the ChatBanMutation object of the builder.

func (*ChatBanUpdateOne) Save

func (_u *ChatBanUpdateOne) Save(ctx context.Context) (*ChatBan, error)

Save executes the query and returns the updated ChatBan entity.

func (*ChatBanUpdateOne) SaveX

func (_u *ChatBanUpdateOne) SaveX(ctx context.Context) *ChatBan

SaveX is like Save, but panics if an error occurs.

func (*ChatBanUpdateOne) Select

func (_u *ChatBanUpdateOne) Select(field string, fields ...string) *ChatBanUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ChatBanUpdateOne) SetBannedByUser

func (_u *ChatBanUpdateOne) SetBannedByUser(v *User) *ChatBanUpdateOne

SetBannedByUser sets the "banned_by_user" edge to the User entity.

func (*ChatBanUpdateOne) SetBannedByUserID

func (_u *ChatBanUpdateOne) SetBannedByUserID(id int) *ChatBanUpdateOne

SetBannedByUserID sets the "banned_by_user" edge to the User entity by ID.

func (*ChatBanUpdateOne) SetIPHash

func (_u *ChatBanUpdateOne) SetIPHash(v string) *ChatBanUpdateOne

SetIPHash sets the "ip_hash" field.

func (*ChatBanUpdateOne) SetNillableIPHash

func (_u *ChatBanUpdateOne) SetNillableIPHash(v *string) *ChatBanUpdateOne

SetNillableIPHash sets the "ip_hash" field if the given value is not nil.

func (*ChatBanUpdateOne) SetNillableReason

func (_u *ChatBanUpdateOne) SetNillableReason(v *string) *ChatBanUpdateOne

SetNillableReason sets the "reason" field if the given value is not nil.

func (*ChatBanUpdateOne) SetNillableUserID

func (_u *ChatBanUpdateOne) SetNillableUserID(id *int) *ChatBanUpdateOne

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*ChatBanUpdateOne) SetReason

func (_u *ChatBanUpdateOne) SetReason(v string) *ChatBanUpdateOne

SetReason sets the "reason" field.

func (*ChatBanUpdateOne) SetRoom

func (_u *ChatBanUpdateOne) SetRoom(v *ChatRoom) *ChatBanUpdateOne

SetRoom sets the "room" edge to the ChatRoom entity.

func (*ChatBanUpdateOne) SetRoomID

func (_u *ChatBanUpdateOne) SetRoomID(id int) *ChatBanUpdateOne

SetRoomID sets the "room" edge to the ChatRoom entity by ID.

func (*ChatBanUpdateOne) SetUser

func (_u *ChatBanUpdateOne) SetUser(v *User) *ChatBanUpdateOne

SetUser sets the "user" edge to the User entity.

func (*ChatBanUpdateOne) SetUserID

func (_u *ChatBanUpdateOne) SetUserID(id int) *ChatBanUpdateOne

SetUserID sets the "user" edge to the User entity by ID.

func (*ChatBanUpdateOne) Where

Where appends a list predicates to the ChatBanUpdate builder.

type ChatBans

type ChatBans []*ChatBan

ChatBans is a parsable slice of ChatBan.

type ChatMessage

type ChatMessage struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Body holds the value of the "body" field.
	Body string `json:"body,omitempty"`
	// SenderName holds the value of the "sender_name" field.
	SenderName string `json:"sender_name,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ChatMessageQuery when eager-loading is set.
	Edges ChatMessageEdges `json:"edges"`
	// contains filtered or unexported fields
}

ChatMessage is the model entity for the ChatMessage schema.

func (*ChatMessage) QueryRoom

func (_m *ChatMessage) QueryRoom() *ChatRoomQuery

QueryRoom queries the "room" edge of the ChatMessage entity.

func (*ChatMessage) QuerySender

func (_m *ChatMessage) QuerySender() *UserQuery

QuerySender queries the "sender" edge of the ChatMessage entity.

func (*ChatMessage) String

func (_m *ChatMessage) String() string

String implements the fmt.Stringer.

func (*ChatMessage) Unwrap

func (_m *ChatMessage) Unwrap() *ChatMessage

Unwrap unwraps the ChatMessage entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*ChatMessage) Update

func (_m *ChatMessage) Update() *ChatMessageUpdateOne

Update returns a builder for updating this ChatMessage. Note that you need to call ChatMessage.Unwrap() before calling this method if this ChatMessage was returned from a transaction, and the transaction was committed or rolled back.

func (*ChatMessage) Value

func (_m *ChatMessage) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the ChatMessage. This includes values selected through modifiers, order, etc.

type ChatMessageClient

type ChatMessageClient struct {
	// contains filtered or unexported fields
}

ChatMessageClient is a client for the ChatMessage schema.

func NewChatMessageClient

func NewChatMessageClient(c config) *ChatMessageClient

NewChatMessageClient returns a client for the ChatMessage from the given config.

func (*ChatMessageClient) Create

func (c *ChatMessageClient) Create() *ChatMessageCreate

Create returns a builder for creating a ChatMessage entity.

func (*ChatMessageClient) CreateBulk

func (c *ChatMessageClient) CreateBulk(builders ...*ChatMessageCreate) *ChatMessageCreateBulk

CreateBulk returns a builder for creating a bulk of ChatMessage entities.

func (*ChatMessageClient) Delete

func (c *ChatMessageClient) Delete() *ChatMessageDelete

Delete returns a delete builder for ChatMessage.

func (*ChatMessageClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ChatMessageClient) DeleteOneID

func (c *ChatMessageClient) DeleteOneID(id int) *ChatMessageDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ChatMessageClient) Get

func (c *ChatMessageClient) Get(ctx context.Context, id int) (*ChatMessage, error)

Get returns a ChatMessage entity by its id.

func (*ChatMessageClient) GetX

func (c *ChatMessageClient) GetX(ctx context.Context, id int) *ChatMessage

GetX is like Get, but panics if an error occurs.

func (*ChatMessageClient) Hooks

func (c *ChatMessageClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ChatMessageClient) Intercept

func (c *ChatMessageClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `chatmessage.Intercept(f(g(h())))`.

func (*ChatMessageClient) Interceptors

func (c *ChatMessageClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ChatMessageClient) MapCreateBulk

func (c *ChatMessageClient) MapCreateBulk(slice any, setFunc func(*ChatMessageCreate, int)) *ChatMessageCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*ChatMessageClient) Query

func (c *ChatMessageClient) Query() *ChatMessageQuery

Query returns a query builder for ChatMessage.

func (*ChatMessageClient) QueryRoom

func (c *ChatMessageClient) QueryRoom(_m *ChatMessage) *ChatRoomQuery

QueryRoom queries the room edge of a ChatMessage.

func (*ChatMessageClient) QuerySender

func (c *ChatMessageClient) QuerySender(_m *ChatMessage) *UserQuery

QuerySender queries the sender edge of a ChatMessage.

func (*ChatMessageClient) Update

func (c *ChatMessageClient) Update() *ChatMessageUpdate

Update returns an update builder for ChatMessage.

func (*ChatMessageClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ChatMessageClient) UpdateOneID

func (c *ChatMessageClient) UpdateOneID(id int) *ChatMessageUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ChatMessageClient) Use

func (c *ChatMessageClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `chatmessage.Hooks(f(g(h())))`.

type ChatMessageCreate

type ChatMessageCreate struct {
	// contains filtered or unexported fields
}

ChatMessageCreate is the builder for creating a ChatMessage entity.

func (*ChatMessageCreate) Exec

func (_c *ChatMessageCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ChatMessageCreate) ExecX

func (_c *ChatMessageCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChatMessageCreate) Mutation

func (_c *ChatMessageCreate) Mutation() *ChatMessageMutation

Mutation returns the ChatMessageMutation object of the builder.

func (*ChatMessageCreate) Save

Save creates the ChatMessage in the database.

func (*ChatMessageCreate) SaveX

func (_c *ChatMessageCreate) SaveX(ctx context.Context) *ChatMessage

SaveX calls Save and panics if Save returns an error.

func (*ChatMessageCreate) SetBody

func (_c *ChatMessageCreate) SetBody(v string) *ChatMessageCreate

SetBody sets the "body" field.

func (*ChatMessageCreate) SetCreatedAt

func (_c *ChatMessageCreate) SetCreatedAt(v time.Time) *ChatMessageCreate

SetCreatedAt sets the "created_at" field.

func (*ChatMessageCreate) SetNillableCreatedAt

func (_c *ChatMessageCreate) SetNillableCreatedAt(v *time.Time) *ChatMessageCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ChatMessageCreate) SetNillableSenderID

func (_c *ChatMessageCreate) SetNillableSenderID(id *int) *ChatMessageCreate

SetNillableSenderID sets the "sender" edge to the User entity by ID if the given value is not nil.

func (*ChatMessageCreate) SetRoom

func (_c *ChatMessageCreate) SetRoom(v *ChatRoom) *ChatMessageCreate

SetRoom sets the "room" edge to the ChatRoom entity.

func (*ChatMessageCreate) SetRoomID

func (_c *ChatMessageCreate) SetRoomID(id int) *ChatMessageCreate

SetRoomID sets the "room" edge to the ChatRoom entity by ID.

func (*ChatMessageCreate) SetSender

func (_c *ChatMessageCreate) SetSender(v *User) *ChatMessageCreate

SetSender sets the "sender" edge to the User entity.

func (*ChatMessageCreate) SetSenderID

func (_c *ChatMessageCreate) SetSenderID(id int) *ChatMessageCreate

SetSenderID sets the "sender" edge to the User entity by ID.

func (*ChatMessageCreate) SetSenderName

func (_c *ChatMessageCreate) SetSenderName(v string) *ChatMessageCreate

SetSenderName sets the "sender_name" field.

type ChatMessageCreateBulk

type ChatMessageCreateBulk struct {
	// contains filtered or unexported fields
}

ChatMessageCreateBulk is the builder for creating many ChatMessage entities in bulk.

func (*ChatMessageCreateBulk) Exec

Exec executes the query.

func (*ChatMessageCreateBulk) ExecX

func (_c *ChatMessageCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChatMessageCreateBulk) Save

Save creates the ChatMessage entities in the database.

func (*ChatMessageCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type ChatMessageDelete

type ChatMessageDelete struct {
	// contains filtered or unexported fields
}

ChatMessageDelete is the builder for deleting a ChatMessage entity.

func (*ChatMessageDelete) Exec

func (_d *ChatMessageDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ChatMessageDelete) ExecX

func (_d *ChatMessageDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ChatMessageDelete) Where

Where appends a list predicates to the ChatMessageDelete builder.

type ChatMessageDeleteOne

type ChatMessageDeleteOne struct {
	// contains filtered or unexported fields
}

ChatMessageDeleteOne is the builder for deleting a single ChatMessage entity.

func (*ChatMessageDeleteOne) Exec

func (_d *ChatMessageDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ChatMessageDeleteOne) ExecX

func (_d *ChatMessageDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChatMessageDeleteOne) Where

Where appends a list predicates to the ChatMessageDelete builder.

type ChatMessageEdges

type ChatMessageEdges struct {
	// Room holds the value of the room edge.
	Room *ChatRoom `json:"room,omitempty"`
	// Sender holds the value of the sender edge.
	Sender *User `json:"sender,omitempty"`
	// contains filtered or unexported fields
}

ChatMessageEdges holds the relations/edges for other nodes in the graph.

func (ChatMessageEdges) RoomOrErr

func (e ChatMessageEdges) RoomOrErr() (*ChatRoom, error)

RoomOrErr returns the Room value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ChatMessageEdges) SenderOrErr

func (e ChatMessageEdges) SenderOrErr() (*User, error)

SenderOrErr returns the Sender value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ChatMessageGroupBy

type ChatMessageGroupBy struct {
	// contains filtered or unexported fields
}

ChatMessageGroupBy is the group-by builder for ChatMessage entities.

func (*ChatMessageGroupBy) Aggregate

func (_g *ChatMessageGroupBy) Aggregate(fns ...AggregateFunc) *ChatMessageGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ChatMessageGroupBy) Bool

func (s *ChatMessageGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ChatMessageGroupBy) BoolX

func (s *ChatMessageGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ChatMessageGroupBy) Bools

func (s *ChatMessageGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ChatMessageGroupBy) BoolsX

func (s *ChatMessageGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ChatMessageGroupBy) Float64

func (s *ChatMessageGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ChatMessageGroupBy) Float64X

func (s *ChatMessageGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ChatMessageGroupBy) Float64s

func (s *ChatMessageGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ChatMessageGroupBy) Float64sX

func (s *ChatMessageGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ChatMessageGroupBy) Int

func (s *ChatMessageGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ChatMessageGroupBy) IntX

func (s *ChatMessageGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ChatMessageGroupBy) Ints

func (s *ChatMessageGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ChatMessageGroupBy) IntsX

func (s *ChatMessageGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ChatMessageGroupBy) Scan

func (_g *ChatMessageGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ChatMessageGroupBy) ScanX

func (s *ChatMessageGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ChatMessageGroupBy) String

func (s *ChatMessageGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ChatMessageGroupBy) StringX

func (s *ChatMessageGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ChatMessageGroupBy) Strings

func (s *ChatMessageGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ChatMessageGroupBy) StringsX

func (s *ChatMessageGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ChatMessageMutation

type ChatMessageMutation struct {
	// contains filtered or unexported fields
}

ChatMessageMutation represents an operation that mutates the ChatMessage nodes in the graph.

func (*ChatMessageMutation) AddField

func (m *ChatMessageMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ChatMessageMutation) AddedEdges

func (m *ChatMessageMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ChatMessageMutation) AddedField

func (m *ChatMessageMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ChatMessageMutation) AddedFields

func (m *ChatMessageMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ChatMessageMutation) AddedIDs

func (m *ChatMessageMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ChatMessageMutation) Body

func (m *ChatMessageMutation) Body() (r string, exists bool)

Body returns the value of the "body" field in the mutation.

func (*ChatMessageMutation) ClearEdge

func (m *ChatMessageMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*ChatMessageMutation) ClearField

func (m *ChatMessageMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*ChatMessageMutation) ClearRoom

func (m *ChatMessageMutation) ClearRoom()

ClearRoom clears the "room" edge to the ChatRoom entity.

func (*ChatMessageMutation) ClearSender

func (m *ChatMessageMutation) ClearSender()

ClearSender clears the "sender" edge to the User entity.

func (*ChatMessageMutation) ClearedEdges

func (m *ChatMessageMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ChatMessageMutation) ClearedFields

func (m *ChatMessageMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ChatMessageMutation) Client

func (m ChatMessageMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*ChatMessageMutation) CreatedAt

func (m *ChatMessageMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ChatMessageMutation) EdgeCleared

func (m *ChatMessageMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ChatMessageMutation) Field

func (m *ChatMessageMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ChatMessageMutation) FieldCleared

func (m *ChatMessageMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ChatMessageMutation) Fields

func (m *ChatMessageMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*ChatMessageMutation) ID

func (m *ChatMessageMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*ChatMessageMutation) IDs

func (m *ChatMessageMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ChatMessageMutation) OldBody

func (m *ChatMessageMutation) OldBody(ctx context.Context) (v string, err error)

OldBody returns the old "body" field's value of the ChatMessage entity. If the ChatMessage object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ChatMessageMutation) OldCreatedAt

func (m *ChatMessageMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the ChatMessage entity. If the ChatMessage object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ChatMessageMutation) OldField

func (m *ChatMessageMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*ChatMessageMutation) OldSenderName

func (m *ChatMessageMutation) OldSenderName(ctx context.Context) (v string, err error)

OldSenderName returns the old "sender_name" field's value of the ChatMessage entity. If the ChatMessage object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ChatMessageMutation) Op

func (m *ChatMessageMutation) Op() Op

Op returns the operation name.

func (*ChatMessageMutation) RemovedEdges

func (m *ChatMessageMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ChatMessageMutation) RemovedIDs

func (m *ChatMessageMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*ChatMessageMutation) ResetBody

func (m *ChatMessageMutation) ResetBody()

ResetBody resets all changes to the "body" field.

func (*ChatMessageMutation) ResetCreatedAt

func (m *ChatMessageMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ChatMessageMutation) ResetEdge

func (m *ChatMessageMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*ChatMessageMutation) ResetField

func (m *ChatMessageMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*ChatMessageMutation) ResetRoom

func (m *ChatMessageMutation) ResetRoom()

ResetRoom resets all changes to the "room" edge.

func (*ChatMessageMutation) ResetSender

func (m *ChatMessageMutation) ResetSender()

ResetSender resets all changes to the "sender" edge.

func (*ChatMessageMutation) ResetSenderName

func (m *ChatMessageMutation) ResetSenderName()

ResetSenderName resets all changes to the "sender_name" field.

func (*ChatMessageMutation) RoomCleared

func (m *ChatMessageMutation) RoomCleared() bool

RoomCleared reports if the "room" edge to the ChatRoom entity was cleared.

func (*ChatMessageMutation) RoomID

func (m *ChatMessageMutation) RoomID() (id int, exists bool)

RoomID returns the "room" edge ID in the mutation.

func (*ChatMessageMutation) RoomIDs

func (m *ChatMessageMutation) RoomIDs() (ids []int)

RoomIDs returns the "room" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use RoomID instead. It exists only for internal usage by the builders.

func (*ChatMessageMutation) SenderCleared

func (m *ChatMessageMutation) SenderCleared() bool

SenderCleared reports if the "sender" edge to the User entity was cleared.

func (*ChatMessageMutation) SenderID

func (m *ChatMessageMutation) SenderID() (id int, exists bool)

SenderID returns the "sender" edge ID in the mutation.

func (*ChatMessageMutation) SenderIDs

func (m *ChatMessageMutation) SenderIDs() (ids []int)

SenderIDs returns the "sender" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use SenderID instead. It exists only for internal usage by the builders.

func (*ChatMessageMutation) SenderName

func (m *ChatMessageMutation) SenderName() (r string, exists bool)

SenderName returns the value of the "sender_name" field in the mutation.

func (*ChatMessageMutation) SetBody

func (m *ChatMessageMutation) SetBody(s string)

SetBody sets the "body" field.

func (*ChatMessageMutation) SetCreatedAt

func (m *ChatMessageMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ChatMessageMutation) SetField

func (m *ChatMessageMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ChatMessageMutation) SetOp

func (m *ChatMessageMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ChatMessageMutation) SetRoomID

func (m *ChatMessageMutation) SetRoomID(id int)

SetRoomID sets the "room" edge to the ChatRoom entity by id.

func (*ChatMessageMutation) SetSenderID

func (m *ChatMessageMutation) SetSenderID(id int)

SetSenderID sets the "sender" edge to the User entity by id.

func (*ChatMessageMutation) SetSenderName

func (m *ChatMessageMutation) SetSenderName(s string)

SetSenderName sets the "sender_name" field.

func (ChatMessageMutation) Tx

func (m ChatMessageMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ChatMessageMutation) Type

func (m *ChatMessageMutation) Type() string

Type returns the node type of this mutation (ChatMessage).

func (*ChatMessageMutation) Where

func (m *ChatMessageMutation) Where(ps ...predicate.ChatMessage)

Where appends a list predicates to the ChatMessageMutation builder.

func (*ChatMessageMutation) WhereP

func (m *ChatMessageMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ChatMessageMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ChatMessageQuery

type ChatMessageQuery struct {
	// contains filtered or unexported fields
}

ChatMessageQuery is the builder for querying ChatMessage entities.

func (*ChatMessageQuery) Aggregate

func (_q *ChatMessageQuery) Aggregate(fns ...AggregateFunc) *ChatMessageSelect

Aggregate returns a ChatMessageSelect configured with the given aggregations.

func (*ChatMessageQuery) All

func (_q *ChatMessageQuery) All(ctx context.Context) ([]*ChatMessage, error)

All executes the query and returns a list of ChatMessages.

func (*ChatMessageQuery) AllX

func (_q *ChatMessageQuery) AllX(ctx context.Context) []*ChatMessage

AllX is like All, but panics if an error occurs.

func (*ChatMessageQuery) Clone

func (_q *ChatMessageQuery) Clone() *ChatMessageQuery

Clone returns a duplicate of the ChatMessageQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ChatMessageQuery) Count

func (_q *ChatMessageQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ChatMessageQuery) CountX

func (_q *ChatMessageQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ChatMessageQuery) Exist

func (_q *ChatMessageQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ChatMessageQuery) ExistX

func (_q *ChatMessageQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ChatMessageQuery) First

func (_q *ChatMessageQuery) First(ctx context.Context) (*ChatMessage, error)

First returns the first ChatMessage entity from the query. Returns a *NotFoundError when no ChatMessage was found.

func (*ChatMessageQuery) FirstID

func (_q *ChatMessageQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first ChatMessage ID from the query. Returns a *NotFoundError when no ChatMessage ID was found.

func (*ChatMessageQuery) FirstIDX

func (_q *ChatMessageQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*ChatMessageQuery) FirstX

func (_q *ChatMessageQuery) FirstX(ctx context.Context) *ChatMessage

FirstX is like First, but panics if an error occurs.

func (*ChatMessageQuery) GroupBy

func (_q *ChatMessageQuery) GroupBy(field string, fields ...string) *ChatMessageGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Body string `json:"body,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ChatMessage.Query().
	GroupBy(chatmessage.FieldBody).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ChatMessageQuery) IDs

func (_q *ChatMessageQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of ChatMessage IDs.

func (*ChatMessageQuery) IDsX

func (_q *ChatMessageQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*ChatMessageQuery) Limit

func (_q *ChatMessageQuery) Limit(limit int) *ChatMessageQuery

Limit the number of records to be returned by this query.

func (*ChatMessageQuery) Offset

func (_q *ChatMessageQuery) Offset(offset int) *ChatMessageQuery

Offset to start from.

func (*ChatMessageQuery) Only

func (_q *ChatMessageQuery) Only(ctx context.Context) (*ChatMessage, error)

Only returns a single ChatMessage entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ChatMessage entity is found. Returns a *NotFoundError when no ChatMessage entities are found.

func (*ChatMessageQuery) OnlyID

func (_q *ChatMessageQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only ChatMessage ID in the query. Returns a *NotSingularError when more than one ChatMessage ID is found. Returns a *NotFoundError when no entities are found.

func (*ChatMessageQuery) OnlyIDX

func (_q *ChatMessageQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ChatMessageQuery) OnlyX

func (_q *ChatMessageQuery) OnlyX(ctx context.Context) *ChatMessage

OnlyX is like Only, but panics if an error occurs.

func (*ChatMessageQuery) Order

Order specifies how the records should be ordered.

func (*ChatMessageQuery) QueryRoom

func (_q *ChatMessageQuery) QueryRoom() *ChatRoomQuery

QueryRoom chains the current query on the "room" edge.

func (*ChatMessageQuery) QuerySender

func (_q *ChatMessageQuery) QuerySender() *UserQuery

QuerySender chains the current query on the "sender" edge.

func (*ChatMessageQuery) Select

func (_q *ChatMessageQuery) Select(fields ...string) *ChatMessageSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Body string `json:"body,omitempty"`
}

client.ChatMessage.Query().
	Select(chatmessage.FieldBody).
	Scan(ctx, &v)

func (*ChatMessageQuery) Unique

func (_q *ChatMessageQuery) Unique(unique bool) *ChatMessageQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*ChatMessageQuery) Where

Where adds a new predicate for the ChatMessageQuery builder.

func (*ChatMessageQuery) WithRoom

func (_q *ChatMessageQuery) WithRoom(opts ...func(*ChatRoomQuery)) *ChatMessageQuery

WithRoom tells the query-builder to eager-load the nodes that are connected to the "room" edge. The optional arguments are used to configure the query builder of the edge.

func (*ChatMessageQuery) WithSender

func (_q *ChatMessageQuery) WithSender(opts ...func(*UserQuery)) *ChatMessageQuery

WithSender tells the query-builder to eager-load the nodes that are connected to the "sender" edge. The optional arguments are used to configure the query builder of the edge.

type ChatMessageSelect

type ChatMessageSelect struct {
	*ChatMessageQuery
	// contains filtered or unexported fields
}

ChatMessageSelect is the builder for selecting fields of ChatMessage entities.

func (*ChatMessageSelect) Aggregate

func (_s *ChatMessageSelect) Aggregate(fns ...AggregateFunc) *ChatMessageSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ChatMessageSelect) Bool

func (s *ChatMessageSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ChatMessageSelect) BoolX

func (s *ChatMessageSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ChatMessageSelect) Bools

func (s *ChatMessageSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ChatMessageSelect) BoolsX

func (s *ChatMessageSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ChatMessageSelect) Float64

func (s *ChatMessageSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ChatMessageSelect) Float64X

func (s *ChatMessageSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ChatMessageSelect) Float64s

func (s *ChatMessageSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ChatMessageSelect) Float64sX

func (s *ChatMessageSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ChatMessageSelect) Int

func (s *ChatMessageSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ChatMessageSelect) IntX

func (s *ChatMessageSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ChatMessageSelect) Ints

func (s *ChatMessageSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ChatMessageSelect) IntsX

func (s *ChatMessageSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ChatMessageSelect) Scan

func (_s *ChatMessageSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ChatMessageSelect) ScanX

func (s *ChatMessageSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ChatMessageSelect) String

func (s *ChatMessageSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ChatMessageSelect) StringX

func (s *ChatMessageSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ChatMessageSelect) Strings

func (s *ChatMessageSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ChatMessageSelect) StringsX

func (s *ChatMessageSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ChatMessageUpdate

type ChatMessageUpdate struct {
	// contains filtered or unexported fields
}

ChatMessageUpdate is the builder for updating ChatMessage entities.

func (*ChatMessageUpdate) ClearRoom

func (_u *ChatMessageUpdate) ClearRoom() *ChatMessageUpdate

ClearRoom clears the "room" edge to the ChatRoom entity.

func (*ChatMessageUpdate) ClearSender

func (_u *ChatMessageUpdate) ClearSender() *ChatMessageUpdate

ClearSender clears the "sender" edge to the User entity.

func (*ChatMessageUpdate) Exec

func (_u *ChatMessageUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ChatMessageUpdate) ExecX

func (_u *ChatMessageUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChatMessageUpdate) Mutation

func (_u *ChatMessageUpdate) Mutation() *ChatMessageMutation

Mutation returns the ChatMessageMutation object of the builder.

func (*ChatMessageUpdate) Save

func (_u *ChatMessageUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ChatMessageUpdate) SaveX

func (_u *ChatMessageUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ChatMessageUpdate) SetBody

func (_u *ChatMessageUpdate) SetBody(v string) *ChatMessageUpdate

SetBody sets the "body" field.

func (*ChatMessageUpdate) SetNillableBody

func (_u *ChatMessageUpdate) SetNillableBody(v *string) *ChatMessageUpdate

SetNillableBody sets the "body" field if the given value is not nil.

func (*ChatMessageUpdate) SetNillableSenderID

func (_u *ChatMessageUpdate) SetNillableSenderID(id *int) *ChatMessageUpdate

SetNillableSenderID sets the "sender" edge to the User entity by ID if the given value is not nil.

func (*ChatMessageUpdate) SetNillableSenderName

func (_u *ChatMessageUpdate) SetNillableSenderName(v *string) *ChatMessageUpdate

SetNillableSenderName sets the "sender_name" field if the given value is not nil.

func (*ChatMessageUpdate) SetRoom

func (_u *ChatMessageUpdate) SetRoom(v *ChatRoom) *ChatMessageUpdate

SetRoom sets the "room" edge to the ChatRoom entity.

func (*ChatMessageUpdate) SetRoomID

func (_u *ChatMessageUpdate) SetRoomID(id int) *ChatMessageUpdate

SetRoomID sets the "room" edge to the ChatRoom entity by ID.

func (*ChatMessageUpdate) SetSender

func (_u *ChatMessageUpdate) SetSender(v *User) *ChatMessageUpdate

SetSender sets the "sender" edge to the User entity.

func (*ChatMessageUpdate) SetSenderID

func (_u *ChatMessageUpdate) SetSenderID(id int) *ChatMessageUpdate

SetSenderID sets the "sender" edge to the User entity by ID.

func (*ChatMessageUpdate) SetSenderName

func (_u *ChatMessageUpdate) SetSenderName(v string) *ChatMessageUpdate

SetSenderName sets the "sender_name" field.

func (*ChatMessageUpdate) Where

Where appends a list predicates to the ChatMessageUpdate builder.

type ChatMessageUpdateOne

type ChatMessageUpdateOne struct {
	// contains filtered or unexported fields
}

ChatMessageUpdateOne is the builder for updating a single ChatMessage entity.

func (*ChatMessageUpdateOne) ClearRoom

func (_u *ChatMessageUpdateOne) ClearRoom() *ChatMessageUpdateOne

ClearRoom clears the "room" edge to the ChatRoom entity.

func (*ChatMessageUpdateOne) ClearSender

func (_u *ChatMessageUpdateOne) ClearSender() *ChatMessageUpdateOne

ClearSender clears the "sender" edge to the User entity.

func (*ChatMessageUpdateOne) Exec

func (_u *ChatMessageUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ChatMessageUpdateOne) ExecX

func (_u *ChatMessageUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChatMessageUpdateOne) Mutation

func (_u *ChatMessageUpdateOne) Mutation() *ChatMessageMutation

Mutation returns the ChatMessageMutation object of the builder.

func (*ChatMessageUpdateOne) Save

Save executes the query and returns the updated ChatMessage entity.

func (*ChatMessageUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*ChatMessageUpdateOne) Select

func (_u *ChatMessageUpdateOne) Select(field string, fields ...string) *ChatMessageUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ChatMessageUpdateOne) SetBody

SetBody sets the "body" field.

func (*ChatMessageUpdateOne) SetNillableBody

func (_u *ChatMessageUpdateOne) SetNillableBody(v *string) *ChatMessageUpdateOne

SetNillableBody sets the "body" field if the given value is not nil.

func (*ChatMessageUpdateOne) SetNillableSenderID

func (_u *ChatMessageUpdateOne) SetNillableSenderID(id *int) *ChatMessageUpdateOne

SetNillableSenderID sets the "sender" edge to the User entity by ID if the given value is not nil.

func (*ChatMessageUpdateOne) SetNillableSenderName

func (_u *ChatMessageUpdateOne) SetNillableSenderName(v *string) *ChatMessageUpdateOne

SetNillableSenderName sets the "sender_name" field if the given value is not nil.

func (*ChatMessageUpdateOne) SetRoom

SetRoom sets the "room" edge to the ChatRoom entity.

func (*ChatMessageUpdateOne) SetRoomID

func (_u *ChatMessageUpdateOne) SetRoomID(id int) *ChatMessageUpdateOne

SetRoomID sets the "room" edge to the ChatRoom entity by ID.

func (*ChatMessageUpdateOne) SetSender

func (_u *ChatMessageUpdateOne) SetSender(v *User) *ChatMessageUpdateOne

SetSender sets the "sender" edge to the User entity.

func (*ChatMessageUpdateOne) SetSenderID

func (_u *ChatMessageUpdateOne) SetSenderID(id int) *ChatMessageUpdateOne

SetSenderID sets the "sender" edge to the User entity by ID.

func (*ChatMessageUpdateOne) SetSenderName

func (_u *ChatMessageUpdateOne) SetSenderName(v string) *ChatMessageUpdateOne

SetSenderName sets the "sender_name" field.

func (*ChatMessageUpdateOne) Where

Where appends a list predicates to the ChatMessageUpdate builder.

type ChatMessages

type ChatMessages []*ChatMessage

ChatMessages is a parsable slice of ChatMessage.

type ChatRoom

type ChatRoom struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// IsPublic holds the value of the "is_public" field.
	IsPublic bool `json:"is_public,omitempty"`
	// PasswordHash holds the value of the "password_hash" field.
	PasswordHash string `json:"-"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ChatRoomQuery when eager-loading is set.
	Edges ChatRoomEdges `json:"edges"`
	// contains filtered or unexported fields
}

ChatRoom is the model entity for the ChatRoom schema.

func (*ChatRoom) QueryBans

func (_m *ChatRoom) QueryBans() *ChatBanQuery

QueryBans queries the "bans" edge of the ChatRoom entity.

func (*ChatRoom) QueryMessages

func (_m *ChatRoom) QueryMessages() *ChatMessageQuery

QueryMessages queries the "messages" edge of the ChatRoom entity.

func (*ChatRoom) QueryOwner

func (_m *ChatRoom) QueryOwner() *UserQuery

QueryOwner queries the "owner" edge of the ChatRoom entity.

func (*ChatRoom) String

func (_m *ChatRoom) String() string

String implements the fmt.Stringer.

func (*ChatRoom) Unwrap

func (_m *ChatRoom) Unwrap() *ChatRoom

Unwrap unwraps the ChatRoom entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*ChatRoom) Update

func (_m *ChatRoom) Update() *ChatRoomUpdateOne

Update returns a builder for updating this ChatRoom. Note that you need to call ChatRoom.Unwrap() before calling this method if this ChatRoom was returned from a transaction, and the transaction was committed or rolled back.

func (*ChatRoom) Value

func (_m *ChatRoom) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the ChatRoom. This includes values selected through modifiers, order, etc.

type ChatRoomClient

type ChatRoomClient struct {
	// contains filtered or unexported fields
}

ChatRoomClient is a client for the ChatRoom schema.

func NewChatRoomClient

func NewChatRoomClient(c config) *ChatRoomClient

NewChatRoomClient returns a client for the ChatRoom from the given config.

func (*ChatRoomClient) Create

func (c *ChatRoomClient) Create() *ChatRoomCreate

Create returns a builder for creating a ChatRoom entity.

func (*ChatRoomClient) CreateBulk

func (c *ChatRoomClient) CreateBulk(builders ...*ChatRoomCreate) *ChatRoomCreateBulk

CreateBulk returns a builder for creating a bulk of ChatRoom entities.

func (*ChatRoomClient) Delete

func (c *ChatRoomClient) Delete() *ChatRoomDelete

Delete returns a delete builder for ChatRoom.

func (*ChatRoomClient) DeleteOne

func (c *ChatRoomClient) DeleteOne(_m *ChatRoom) *ChatRoomDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ChatRoomClient) DeleteOneID

func (c *ChatRoomClient) DeleteOneID(id int) *ChatRoomDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ChatRoomClient) Get

func (c *ChatRoomClient) Get(ctx context.Context, id int) (*ChatRoom, error)

Get returns a ChatRoom entity by its id.

func (*ChatRoomClient) GetX

func (c *ChatRoomClient) GetX(ctx context.Context, id int) *ChatRoom

GetX is like Get, but panics if an error occurs.

func (*ChatRoomClient) Hooks

func (c *ChatRoomClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ChatRoomClient) Intercept

func (c *ChatRoomClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `chatroom.Intercept(f(g(h())))`.

func (*ChatRoomClient) Interceptors

func (c *ChatRoomClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ChatRoomClient) MapCreateBulk

func (c *ChatRoomClient) MapCreateBulk(slice any, setFunc func(*ChatRoomCreate, int)) *ChatRoomCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*ChatRoomClient) Query

func (c *ChatRoomClient) Query() *ChatRoomQuery

Query returns a query builder for ChatRoom.

func (*ChatRoomClient) QueryBans

func (c *ChatRoomClient) QueryBans(_m *ChatRoom) *ChatBanQuery

QueryBans queries the bans edge of a ChatRoom.

func (*ChatRoomClient) QueryMessages

func (c *ChatRoomClient) QueryMessages(_m *ChatRoom) *ChatMessageQuery

QueryMessages queries the messages edge of a ChatRoom.

func (*ChatRoomClient) QueryOwner

func (c *ChatRoomClient) QueryOwner(_m *ChatRoom) *UserQuery

QueryOwner queries the owner edge of a ChatRoom.

func (*ChatRoomClient) Update

func (c *ChatRoomClient) Update() *ChatRoomUpdate

Update returns an update builder for ChatRoom.

func (*ChatRoomClient) UpdateOne

func (c *ChatRoomClient) UpdateOne(_m *ChatRoom) *ChatRoomUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ChatRoomClient) UpdateOneID

func (c *ChatRoomClient) UpdateOneID(id int) *ChatRoomUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ChatRoomClient) Use

func (c *ChatRoomClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `chatroom.Hooks(f(g(h())))`.

type ChatRoomCreate

type ChatRoomCreate struct {
	// contains filtered or unexported fields
}

ChatRoomCreate is the builder for creating a ChatRoom entity.

func (*ChatRoomCreate) AddBanIDs

func (_c *ChatRoomCreate) AddBanIDs(ids ...int) *ChatRoomCreate

AddBanIDs adds the "bans" edge to the ChatBan entity by IDs.

func (*ChatRoomCreate) AddBans

func (_c *ChatRoomCreate) AddBans(v ...*ChatBan) *ChatRoomCreate

AddBans adds the "bans" edges to the ChatBan entity.

func (*ChatRoomCreate) AddMessageIDs

func (_c *ChatRoomCreate) AddMessageIDs(ids ...int) *ChatRoomCreate

AddMessageIDs adds the "messages" edge to the ChatMessage entity by IDs.

func (*ChatRoomCreate) AddMessages

func (_c *ChatRoomCreate) AddMessages(v ...*ChatMessage) *ChatRoomCreate

AddMessages adds the "messages" edges to the ChatMessage entity.

func (*ChatRoomCreate) Exec

func (_c *ChatRoomCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ChatRoomCreate) ExecX

func (_c *ChatRoomCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChatRoomCreate) Mutation

func (_c *ChatRoomCreate) Mutation() *ChatRoomMutation

Mutation returns the ChatRoomMutation object of the builder.

func (*ChatRoomCreate) Save

func (_c *ChatRoomCreate) Save(ctx context.Context) (*ChatRoom, error)

Save creates the ChatRoom in the database.

func (*ChatRoomCreate) SaveX

func (_c *ChatRoomCreate) SaveX(ctx context.Context) *ChatRoom

SaveX calls Save and panics if Save returns an error.

func (*ChatRoomCreate) SetCreatedAt

func (_c *ChatRoomCreate) SetCreatedAt(v time.Time) *ChatRoomCreate

SetCreatedAt sets the "created_at" field.

func (*ChatRoomCreate) SetIsPublic

func (_c *ChatRoomCreate) SetIsPublic(v bool) *ChatRoomCreate

SetIsPublic sets the "is_public" field.

func (*ChatRoomCreate) SetName

func (_c *ChatRoomCreate) SetName(v string) *ChatRoomCreate

SetName sets the "name" field.

func (*ChatRoomCreate) SetNillableCreatedAt

func (_c *ChatRoomCreate) SetNillableCreatedAt(v *time.Time) *ChatRoomCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ChatRoomCreate) SetNillableIsPublic

func (_c *ChatRoomCreate) SetNillableIsPublic(v *bool) *ChatRoomCreate

SetNillableIsPublic sets the "is_public" field if the given value is not nil.

func (*ChatRoomCreate) SetNillableOwnerID

func (_c *ChatRoomCreate) SetNillableOwnerID(id *int) *ChatRoomCreate

SetNillableOwnerID sets the "owner" edge to the User entity by ID if the given value is not nil.

func (*ChatRoomCreate) SetNillablePasswordHash

func (_c *ChatRoomCreate) SetNillablePasswordHash(v *string) *ChatRoomCreate

SetNillablePasswordHash sets the "password_hash" field if the given value is not nil.

func (*ChatRoomCreate) SetOwner

func (_c *ChatRoomCreate) SetOwner(v *User) *ChatRoomCreate

SetOwner sets the "owner" edge to the User entity.

func (*ChatRoomCreate) SetOwnerID

func (_c *ChatRoomCreate) SetOwnerID(id int) *ChatRoomCreate

SetOwnerID sets the "owner" edge to the User entity by ID.

func (*ChatRoomCreate) SetPasswordHash

func (_c *ChatRoomCreate) SetPasswordHash(v string) *ChatRoomCreate

SetPasswordHash sets the "password_hash" field.

type ChatRoomCreateBulk

type ChatRoomCreateBulk struct {
	// contains filtered or unexported fields
}

ChatRoomCreateBulk is the builder for creating many ChatRoom entities in bulk.

func (*ChatRoomCreateBulk) Exec

func (_c *ChatRoomCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ChatRoomCreateBulk) ExecX

func (_c *ChatRoomCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChatRoomCreateBulk) Save

func (_c *ChatRoomCreateBulk) Save(ctx context.Context) ([]*ChatRoom, error)

Save creates the ChatRoom entities in the database.

func (*ChatRoomCreateBulk) SaveX

func (_c *ChatRoomCreateBulk) SaveX(ctx context.Context) []*ChatRoom

SaveX is like Save, but panics if an error occurs.

type ChatRoomDelete

type ChatRoomDelete struct {
	// contains filtered or unexported fields
}

ChatRoomDelete is the builder for deleting a ChatRoom entity.

func (*ChatRoomDelete) Exec

func (_d *ChatRoomDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ChatRoomDelete) ExecX

func (_d *ChatRoomDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ChatRoomDelete) Where

func (_d *ChatRoomDelete) Where(ps ...predicate.ChatRoom) *ChatRoomDelete

Where appends a list predicates to the ChatRoomDelete builder.

type ChatRoomDeleteOne

type ChatRoomDeleteOne struct {
	// contains filtered or unexported fields
}

ChatRoomDeleteOne is the builder for deleting a single ChatRoom entity.

func (*ChatRoomDeleteOne) Exec

func (_d *ChatRoomDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ChatRoomDeleteOne) ExecX

func (_d *ChatRoomDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChatRoomDeleteOne) Where

Where appends a list predicates to the ChatRoomDelete builder.

type ChatRoomEdges

type ChatRoomEdges struct {
	// Owner holds the value of the owner edge.
	Owner *User `json:"owner,omitempty"`
	// Messages holds the value of the messages edge.
	Messages []*ChatMessage `json:"messages,omitempty"`
	// Bans holds the value of the bans edge.
	Bans []*ChatBan `json:"bans,omitempty"`
	// contains filtered or unexported fields
}

ChatRoomEdges holds the relations/edges for other nodes in the graph.

func (ChatRoomEdges) BansOrErr

func (e ChatRoomEdges) BansOrErr() ([]*ChatBan, error)

BansOrErr returns the Bans value or an error if the edge was not loaded in eager-loading.

func (ChatRoomEdges) MessagesOrErr

func (e ChatRoomEdges) MessagesOrErr() ([]*ChatMessage, error)

MessagesOrErr returns the Messages value or an error if the edge was not loaded in eager-loading.

func (ChatRoomEdges) OwnerOrErr

func (e ChatRoomEdges) OwnerOrErr() (*User, error)

OwnerOrErr returns the Owner value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ChatRoomGroupBy

type ChatRoomGroupBy struct {
	// contains filtered or unexported fields
}

ChatRoomGroupBy is the group-by builder for ChatRoom entities.

func (*ChatRoomGroupBy) Aggregate

func (_g *ChatRoomGroupBy) Aggregate(fns ...AggregateFunc) *ChatRoomGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ChatRoomGroupBy) Bool

func (s *ChatRoomGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ChatRoomGroupBy) BoolX

func (s *ChatRoomGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ChatRoomGroupBy) Bools

func (s *ChatRoomGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ChatRoomGroupBy) BoolsX

func (s *ChatRoomGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ChatRoomGroupBy) Float64

func (s *ChatRoomGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ChatRoomGroupBy) Float64X

func (s *ChatRoomGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ChatRoomGroupBy) Float64s

func (s *ChatRoomGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ChatRoomGroupBy) Float64sX

func (s *ChatRoomGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ChatRoomGroupBy) Int

func (s *ChatRoomGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ChatRoomGroupBy) IntX

func (s *ChatRoomGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ChatRoomGroupBy) Ints

func (s *ChatRoomGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ChatRoomGroupBy) IntsX

func (s *ChatRoomGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ChatRoomGroupBy) Scan

func (_g *ChatRoomGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ChatRoomGroupBy) ScanX

func (s *ChatRoomGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ChatRoomGroupBy) String

func (s *ChatRoomGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ChatRoomGroupBy) StringX

func (s *ChatRoomGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ChatRoomGroupBy) Strings

func (s *ChatRoomGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ChatRoomGroupBy) StringsX

func (s *ChatRoomGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ChatRoomMutation

type ChatRoomMutation struct {
	// contains filtered or unexported fields
}

ChatRoomMutation represents an operation that mutates the ChatRoom nodes in the graph.

func (*ChatRoomMutation) AddBanIDs

func (m *ChatRoomMutation) AddBanIDs(ids ...int)

AddBanIDs adds the "bans" edge to the ChatBan entity by ids.

func (*ChatRoomMutation) AddField

func (m *ChatRoomMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ChatRoomMutation) AddMessageIDs

func (m *ChatRoomMutation) AddMessageIDs(ids ...int)

AddMessageIDs adds the "messages" edge to the ChatMessage entity by ids.

func (*ChatRoomMutation) AddedEdges

func (m *ChatRoomMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ChatRoomMutation) AddedField

func (m *ChatRoomMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ChatRoomMutation) AddedFields

func (m *ChatRoomMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ChatRoomMutation) AddedIDs

func (m *ChatRoomMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ChatRoomMutation) BansCleared

func (m *ChatRoomMutation) BansCleared() bool

BansCleared reports if the "bans" edge to the ChatBan entity was cleared.

func (*ChatRoomMutation) BansIDs

func (m *ChatRoomMutation) BansIDs() (ids []int)

BansIDs returns the "bans" edge IDs in the mutation.

func (*ChatRoomMutation) ClearBans

func (m *ChatRoomMutation) ClearBans()

ClearBans clears the "bans" edge to the ChatBan entity.

func (*ChatRoomMutation) ClearEdge

func (m *ChatRoomMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*ChatRoomMutation) ClearField

func (m *ChatRoomMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*ChatRoomMutation) ClearMessages

func (m *ChatRoomMutation) ClearMessages()

ClearMessages clears the "messages" edge to the ChatMessage entity.

func (*ChatRoomMutation) ClearOwner

func (m *ChatRoomMutation) ClearOwner()

ClearOwner clears the "owner" edge to the User entity.

func (*ChatRoomMutation) ClearPasswordHash

func (m *ChatRoomMutation) ClearPasswordHash()

ClearPasswordHash clears the value of the "password_hash" field.

func (*ChatRoomMutation) ClearedEdges

func (m *ChatRoomMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ChatRoomMutation) ClearedFields

func (m *ChatRoomMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ChatRoomMutation) Client

func (m ChatRoomMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*ChatRoomMutation) CreatedAt

func (m *ChatRoomMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ChatRoomMutation) EdgeCleared

func (m *ChatRoomMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ChatRoomMutation) Field

func (m *ChatRoomMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ChatRoomMutation) FieldCleared

func (m *ChatRoomMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ChatRoomMutation) Fields

func (m *ChatRoomMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*ChatRoomMutation) ID

func (m *ChatRoomMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*ChatRoomMutation) IDs

func (m *ChatRoomMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ChatRoomMutation) IsPublic

func (m *ChatRoomMutation) IsPublic() (r bool, exists bool)

IsPublic returns the value of the "is_public" field in the mutation.

func (*ChatRoomMutation) MessagesCleared

func (m *ChatRoomMutation) MessagesCleared() bool

MessagesCleared reports if the "messages" edge to the ChatMessage entity was cleared.

func (*ChatRoomMutation) MessagesIDs

func (m *ChatRoomMutation) MessagesIDs() (ids []int)

MessagesIDs returns the "messages" edge IDs in the mutation.

func (*ChatRoomMutation) Name

func (m *ChatRoomMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*ChatRoomMutation) OldCreatedAt

func (m *ChatRoomMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the ChatRoom entity. If the ChatRoom object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ChatRoomMutation) OldField

func (m *ChatRoomMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*ChatRoomMutation) OldIsPublic

func (m *ChatRoomMutation) OldIsPublic(ctx context.Context) (v bool, err error)

OldIsPublic returns the old "is_public" field's value of the ChatRoom entity. If the ChatRoom object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ChatRoomMutation) OldName

func (m *ChatRoomMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the ChatRoom entity. If the ChatRoom object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ChatRoomMutation) OldPasswordHash

func (m *ChatRoomMutation) OldPasswordHash(ctx context.Context) (v string, err error)

OldPasswordHash returns the old "password_hash" field's value of the ChatRoom entity. If the ChatRoom object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ChatRoomMutation) Op

func (m *ChatRoomMutation) Op() Op

Op returns the operation name.

func (*ChatRoomMutation) OwnerCleared

func (m *ChatRoomMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the User entity was cleared.

func (*ChatRoomMutation) OwnerID

func (m *ChatRoomMutation) OwnerID() (id int, exists bool)

OwnerID returns the "owner" edge ID in the mutation.

func (*ChatRoomMutation) OwnerIDs

func (m *ChatRoomMutation) OwnerIDs() (ids []int)

OwnerIDs returns the "owner" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OwnerID instead. It exists only for internal usage by the builders.

func (*ChatRoomMutation) PasswordHash

func (m *ChatRoomMutation) PasswordHash() (r string, exists bool)

PasswordHash returns the value of the "password_hash" field in the mutation.

func (*ChatRoomMutation) PasswordHashCleared

func (m *ChatRoomMutation) PasswordHashCleared() bool

PasswordHashCleared returns if the "password_hash" field was cleared in this mutation.

func (*ChatRoomMutation) RemoveBanIDs

func (m *ChatRoomMutation) RemoveBanIDs(ids ...int)

RemoveBanIDs removes the "bans" edge to the ChatBan entity by IDs.

func (*ChatRoomMutation) RemoveMessageIDs

func (m *ChatRoomMutation) RemoveMessageIDs(ids ...int)

RemoveMessageIDs removes the "messages" edge to the ChatMessage entity by IDs.

func (*ChatRoomMutation) RemovedBansIDs

func (m *ChatRoomMutation) RemovedBansIDs() (ids []int)

RemovedBans returns the removed IDs of the "bans" edge to the ChatBan entity.

func (*ChatRoomMutation) RemovedEdges

func (m *ChatRoomMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ChatRoomMutation) RemovedIDs

func (m *ChatRoomMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*ChatRoomMutation) RemovedMessagesIDs

func (m *ChatRoomMutation) RemovedMessagesIDs() (ids []int)

RemovedMessages returns the removed IDs of the "messages" edge to the ChatMessage entity.

func (*ChatRoomMutation) ResetBans

func (m *ChatRoomMutation) ResetBans()

ResetBans resets all changes to the "bans" edge.

func (*ChatRoomMutation) ResetCreatedAt

func (m *ChatRoomMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ChatRoomMutation) ResetEdge

func (m *ChatRoomMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*ChatRoomMutation) ResetField

func (m *ChatRoomMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*ChatRoomMutation) ResetIsPublic

func (m *ChatRoomMutation) ResetIsPublic()

ResetIsPublic resets all changes to the "is_public" field.

func (*ChatRoomMutation) ResetMessages

func (m *ChatRoomMutation) ResetMessages()

ResetMessages resets all changes to the "messages" edge.

func (*ChatRoomMutation) ResetName

func (m *ChatRoomMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ChatRoomMutation) ResetOwner

func (m *ChatRoomMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*ChatRoomMutation) ResetPasswordHash

func (m *ChatRoomMutation) ResetPasswordHash()

ResetPasswordHash resets all changes to the "password_hash" field.

func (*ChatRoomMutation) SetCreatedAt

func (m *ChatRoomMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ChatRoomMutation) SetField

func (m *ChatRoomMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ChatRoomMutation) SetIsPublic

func (m *ChatRoomMutation) SetIsPublic(b bool)

SetIsPublic sets the "is_public" field.

func (*ChatRoomMutation) SetName

func (m *ChatRoomMutation) SetName(s string)

SetName sets the "name" field.

func (*ChatRoomMutation) SetOp

func (m *ChatRoomMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ChatRoomMutation) SetOwnerID

func (m *ChatRoomMutation) SetOwnerID(id int)

SetOwnerID sets the "owner" edge to the User entity by id.

func (*ChatRoomMutation) SetPasswordHash

func (m *ChatRoomMutation) SetPasswordHash(s string)

SetPasswordHash sets the "password_hash" field.

func (ChatRoomMutation) Tx

func (m ChatRoomMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ChatRoomMutation) Type

func (m *ChatRoomMutation) Type() string

Type returns the node type of this mutation (ChatRoom).

func (*ChatRoomMutation) Where

func (m *ChatRoomMutation) Where(ps ...predicate.ChatRoom)

Where appends a list predicates to the ChatRoomMutation builder.

func (*ChatRoomMutation) WhereP

func (m *ChatRoomMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ChatRoomMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ChatRoomQuery

type ChatRoomQuery struct {
	// contains filtered or unexported fields
}

ChatRoomQuery is the builder for querying ChatRoom entities.

func (*ChatRoomQuery) Aggregate

func (_q *ChatRoomQuery) Aggregate(fns ...AggregateFunc) *ChatRoomSelect

Aggregate returns a ChatRoomSelect configured with the given aggregations.

func (*ChatRoomQuery) All

func (_q *ChatRoomQuery) All(ctx context.Context) ([]*ChatRoom, error)

All executes the query and returns a list of ChatRooms.

func (*ChatRoomQuery) AllX

func (_q *ChatRoomQuery) AllX(ctx context.Context) []*ChatRoom

AllX is like All, but panics if an error occurs.

func (*ChatRoomQuery) Clone

func (_q *ChatRoomQuery) Clone() *ChatRoomQuery

Clone returns a duplicate of the ChatRoomQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ChatRoomQuery) Count

func (_q *ChatRoomQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ChatRoomQuery) CountX

func (_q *ChatRoomQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ChatRoomQuery) Exist

func (_q *ChatRoomQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ChatRoomQuery) ExistX

func (_q *ChatRoomQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ChatRoomQuery) First

func (_q *ChatRoomQuery) First(ctx context.Context) (*ChatRoom, error)

First returns the first ChatRoom entity from the query. Returns a *NotFoundError when no ChatRoom was found.

func (*ChatRoomQuery) FirstID

func (_q *ChatRoomQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first ChatRoom ID from the query. Returns a *NotFoundError when no ChatRoom ID was found.

func (*ChatRoomQuery) FirstIDX

func (_q *ChatRoomQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*ChatRoomQuery) FirstX

func (_q *ChatRoomQuery) FirstX(ctx context.Context) *ChatRoom

FirstX is like First, but panics if an error occurs.

func (*ChatRoomQuery) GroupBy

func (_q *ChatRoomQuery) GroupBy(field string, fields ...string) *ChatRoomGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ChatRoom.Query().
	GroupBy(chatroom.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ChatRoomQuery) IDs

func (_q *ChatRoomQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of ChatRoom IDs.

func (*ChatRoomQuery) IDsX

func (_q *ChatRoomQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*ChatRoomQuery) Limit

func (_q *ChatRoomQuery) Limit(limit int) *ChatRoomQuery

Limit the number of records to be returned by this query.

func (*ChatRoomQuery) Offset

func (_q *ChatRoomQuery) Offset(offset int) *ChatRoomQuery

Offset to start from.

func (*ChatRoomQuery) Only

func (_q *ChatRoomQuery) Only(ctx context.Context) (*ChatRoom, error)

Only returns a single ChatRoom entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ChatRoom entity is found. Returns a *NotFoundError when no ChatRoom entities are found.

func (*ChatRoomQuery) OnlyID

func (_q *ChatRoomQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only ChatRoom ID in the query. Returns a *NotSingularError when more than one ChatRoom ID is found. Returns a *NotFoundError when no entities are found.

func (*ChatRoomQuery) OnlyIDX

func (_q *ChatRoomQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ChatRoomQuery) OnlyX

func (_q *ChatRoomQuery) OnlyX(ctx context.Context) *ChatRoom

OnlyX is like Only, but panics if an error occurs.

func (*ChatRoomQuery) Order

Order specifies how the records should be ordered.

func (*ChatRoomQuery) QueryBans

func (_q *ChatRoomQuery) QueryBans() *ChatBanQuery

QueryBans chains the current query on the "bans" edge.

func (*ChatRoomQuery) QueryMessages

func (_q *ChatRoomQuery) QueryMessages() *ChatMessageQuery

QueryMessages chains the current query on the "messages" edge.

func (*ChatRoomQuery) QueryOwner

func (_q *ChatRoomQuery) QueryOwner() *UserQuery

QueryOwner chains the current query on the "owner" edge.

func (*ChatRoomQuery) Select

func (_q *ChatRoomQuery) Select(fields ...string) *ChatRoomSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.ChatRoom.Query().
	Select(chatroom.FieldName).
	Scan(ctx, &v)

func (*ChatRoomQuery) Unique

func (_q *ChatRoomQuery) Unique(unique bool) *ChatRoomQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*ChatRoomQuery) Where

func (_q *ChatRoomQuery) Where(ps ...predicate.ChatRoom) *ChatRoomQuery

Where adds a new predicate for the ChatRoomQuery builder.

func (*ChatRoomQuery) WithBans

func (_q *ChatRoomQuery) WithBans(opts ...func(*ChatBanQuery)) *ChatRoomQuery

WithBans tells the query-builder to eager-load the nodes that are connected to the "bans" edge. The optional arguments are used to configure the query builder of the edge.

func (*ChatRoomQuery) WithMessages

func (_q *ChatRoomQuery) WithMessages(opts ...func(*ChatMessageQuery)) *ChatRoomQuery

WithMessages tells the query-builder to eager-load the nodes that are connected to the "messages" edge. The optional arguments are used to configure the query builder of the edge.

func (*ChatRoomQuery) WithOwner

func (_q *ChatRoomQuery) WithOwner(opts ...func(*UserQuery)) *ChatRoomQuery

WithOwner tells the query-builder to eager-load the nodes that are connected to the "owner" edge. The optional arguments are used to configure the query builder of the edge.

type ChatRoomSelect

type ChatRoomSelect struct {
	*ChatRoomQuery
	// contains filtered or unexported fields
}

ChatRoomSelect is the builder for selecting fields of ChatRoom entities.

func (*ChatRoomSelect) Aggregate

func (_s *ChatRoomSelect) Aggregate(fns ...AggregateFunc) *ChatRoomSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ChatRoomSelect) Bool

func (s *ChatRoomSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ChatRoomSelect) BoolX

func (s *ChatRoomSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ChatRoomSelect) Bools

func (s *ChatRoomSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ChatRoomSelect) BoolsX

func (s *ChatRoomSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ChatRoomSelect) Float64

func (s *ChatRoomSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ChatRoomSelect) Float64X

func (s *ChatRoomSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ChatRoomSelect) Float64s

func (s *ChatRoomSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ChatRoomSelect) Float64sX

func (s *ChatRoomSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ChatRoomSelect) Int

func (s *ChatRoomSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ChatRoomSelect) IntX

func (s *ChatRoomSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ChatRoomSelect) Ints

func (s *ChatRoomSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ChatRoomSelect) IntsX

func (s *ChatRoomSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ChatRoomSelect) Scan

func (_s *ChatRoomSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ChatRoomSelect) ScanX

func (s *ChatRoomSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ChatRoomSelect) String

func (s *ChatRoomSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ChatRoomSelect) StringX

func (s *ChatRoomSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ChatRoomSelect) Strings

func (s *ChatRoomSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ChatRoomSelect) StringsX

func (s *ChatRoomSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ChatRoomUpdate

type ChatRoomUpdate struct {
	// contains filtered or unexported fields
}

ChatRoomUpdate is the builder for updating ChatRoom entities.

func (*ChatRoomUpdate) AddBanIDs

func (_u *ChatRoomUpdate) AddBanIDs(ids ...int) *ChatRoomUpdate

AddBanIDs adds the "bans" edge to the ChatBan entity by IDs.

func (*ChatRoomUpdate) AddBans

func (_u *ChatRoomUpdate) AddBans(v ...*ChatBan) *ChatRoomUpdate

AddBans adds the "bans" edges to the ChatBan entity.

func (*ChatRoomUpdate) AddMessageIDs

func (_u *ChatRoomUpdate) AddMessageIDs(ids ...int) *ChatRoomUpdate

AddMessageIDs adds the "messages" edge to the ChatMessage entity by IDs.

func (*ChatRoomUpdate) AddMessages

func (_u *ChatRoomUpdate) AddMessages(v ...*ChatMessage) *ChatRoomUpdate

AddMessages adds the "messages" edges to the ChatMessage entity.

func (*ChatRoomUpdate) ClearBans

func (_u *ChatRoomUpdate) ClearBans() *ChatRoomUpdate

ClearBans clears all "bans" edges to the ChatBan entity.

func (*ChatRoomUpdate) ClearMessages

func (_u *ChatRoomUpdate) ClearMessages() *ChatRoomUpdate

ClearMessages clears all "messages" edges to the ChatMessage entity.

func (*ChatRoomUpdate) ClearOwner

func (_u *ChatRoomUpdate) ClearOwner() *ChatRoomUpdate

ClearOwner clears the "owner" edge to the User entity.

func (*ChatRoomUpdate) ClearPasswordHash

func (_u *ChatRoomUpdate) ClearPasswordHash() *ChatRoomUpdate

ClearPasswordHash clears the value of the "password_hash" field.

func (*ChatRoomUpdate) Exec

func (_u *ChatRoomUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ChatRoomUpdate) ExecX

func (_u *ChatRoomUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChatRoomUpdate) Mutation

func (_u *ChatRoomUpdate) Mutation() *ChatRoomMutation

Mutation returns the ChatRoomMutation object of the builder.

func (*ChatRoomUpdate) RemoveBanIDs

func (_u *ChatRoomUpdate) RemoveBanIDs(ids ...int) *ChatRoomUpdate

RemoveBanIDs removes the "bans" edge to ChatBan entities by IDs.

func (*ChatRoomUpdate) RemoveBans

func (_u *ChatRoomUpdate) RemoveBans(v ...*ChatBan) *ChatRoomUpdate

RemoveBans removes "bans" edges to ChatBan entities.

func (*ChatRoomUpdate) RemoveMessageIDs

func (_u *ChatRoomUpdate) RemoveMessageIDs(ids ...int) *ChatRoomUpdate

RemoveMessageIDs removes the "messages" edge to ChatMessage entities by IDs.

func (*ChatRoomUpdate) RemoveMessages

func (_u *ChatRoomUpdate) RemoveMessages(v ...*ChatMessage) *ChatRoomUpdate

RemoveMessages removes "messages" edges to ChatMessage entities.

func (*ChatRoomUpdate) Save

func (_u *ChatRoomUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ChatRoomUpdate) SaveX

func (_u *ChatRoomUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ChatRoomUpdate) SetIsPublic

func (_u *ChatRoomUpdate) SetIsPublic(v bool) *ChatRoomUpdate

SetIsPublic sets the "is_public" field.

func (*ChatRoomUpdate) SetName

func (_u *ChatRoomUpdate) SetName(v string) *ChatRoomUpdate

SetName sets the "name" field.

func (*ChatRoomUpdate) SetNillableIsPublic

func (_u *ChatRoomUpdate) SetNillableIsPublic(v *bool) *ChatRoomUpdate

SetNillableIsPublic sets the "is_public" field if the given value is not nil.

func (*ChatRoomUpdate) SetNillableName

func (_u *ChatRoomUpdate) SetNillableName(v *string) *ChatRoomUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*ChatRoomUpdate) SetNillableOwnerID

func (_u *ChatRoomUpdate) SetNillableOwnerID(id *int) *ChatRoomUpdate

SetNillableOwnerID sets the "owner" edge to the User entity by ID if the given value is not nil.

func (*ChatRoomUpdate) SetNillablePasswordHash

func (_u *ChatRoomUpdate) SetNillablePasswordHash(v *string) *ChatRoomUpdate

SetNillablePasswordHash sets the "password_hash" field if the given value is not nil.

func (*ChatRoomUpdate) SetOwner

func (_u *ChatRoomUpdate) SetOwner(v *User) *ChatRoomUpdate

SetOwner sets the "owner" edge to the User entity.

func (*ChatRoomUpdate) SetOwnerID

func (_u *ChatRoomUpdate) SetOwnerID(id int) *ChatRoomUpdate

SetOwnerID sets the "owner" edge to the User entity by ID.

func (*ChatRoomUpdate) SetPasswordHash

func (_u *ChatRoomUpdate) SetPasswordHash(v string) *ChatRoomUpdate

SetPasswordHash sets the "password_hash" field.

func (*ChatRoomUpdate) Where

func (_u *ChatRoomUpdate) Where(ps ...predicate.ChatRoom) *ChatRoomUpdate

Where appends a list predicates to the ChatRoomUpdate builder.

type ChatRoomUpdateOne

type ChatRoomUpdateOne struct {
	// contains filtered or unexported fields
}

ChatRoomUpdateOne is the builder for updating a single ChatRoom entity.

func (*ChatRoomUpdateOne) AddBanIDs

func (_u *ChatRoomUpdateOne) AddBanIDs(ids ...int) *ChatRoomUpdateOne

AddBanIDs adds the "bans" edge to the ChatBan entity by IDs.

func (*ChatRoomUpdateOne) AddBans

func (_u *ChatRoomUpdateOne) AddBans(v ...*ChatBan) *ChatRoomUpdateOne

AddBans adds the "bans" edges to the ChatBan entity.

func (*ChatRoomUpdateOne) AddMessageIDs

func (_u *ChatRoomUpdateOne) AddMessageIDs(ids ...int) *ChatRoomUpdateOne

AddMessageIDs adds the "messages" edge to the ChatMessage entity by IDs.

func (*ChatRoomUpdateOne) AddMessages

func (_u *ChatRoomUpdateOne) AddMessages(v ...*ChatMessage) *ChatRoomUpdateOne

AddMessages adds the "messages" edges to the ChatMessage entity.

func (*ChatRoomUpdateOne) ClearBans

func (_u *ChatRoomUpdateOne) ClearBans() *ChatRoomUpdateOne

ClearBans clears all "bans" edges to the ChatBan entity.

func (*ChatRoomUpdateOne) ClearMessages

func (_u *ChatRoomUpdateOne) ClearMessages() *ChatRoomUpdateOne

ClearMessages clears all "messages" edges to the ChatMessage entity.

func (*ChatRoomUpdateOne) ClearOwner

func (_u *ChatRoomUpdateOne) ClearOwner() *ChatRoomUpdateOne

ClearOwner clears the "owner" edge to the User entity.

func (*ChatRoomUpdateOne) ClearPasswordHash

func (_u *ChatRoomUpdateOne) ClearPasswordHash() *ChatRoomUpdateOne

ClearPasswordHash clears the value of the "password_hash" field.

func (*ChatRoomUpdateOne) Exec

func (_u *ChatRoomUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ChatRoomUpdateOne) ExecX

func (_u *ChatRoomUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChatRoomUpdateOne) Mutation

func (_u *ChatRoomUpdateOne) Mutation() *ChatRoomMutation

Mutation returns the ChatRoomMutation object of the builder.

func (*ChatRoomUpdateOne) RemoveBanIDs

func (_u *ChatRoomUpdateOne) RemoveBanIDs(ids ...int) *ChatRoomUpdateOne

RemoveBanIDs removes the "bans" edge to ChatBan entities by IDs.

func (*ChatRoomUpdateOne) RemoveBans

func (_u *ChatRoomUpdateOne) RemoveBans(v ...*ChatBan) *ChatRoomUpdateOne

RemoveBans removes "bans" edges to ChatBan entities.

func (*ChatRoomUpdateOne) RemoveMessageIDs

func (_u *ChatRoomUpdateOne) RemoveMessageIDs(ids ...int) *ChatRoomUpdateOne

RemoveMessageIDs removes the "messages" edge to ChatMessage entities by IDs.

func (*ChatRoomUpdateOne) RemoveMessages

func (_u *ChatRoomUpdateOne) RemoveMessages(v ...*ChatMessage) *ChatRoomUpdateOne

RemoveMessages removes "messages" edges to ChatMessage entities.

func (*ChatRoomUpdateOne) Save

func (_u *ChatRoomUpdateOne) Save(ctx context.Context) (*ChatRoom, error)

Save executes the query and returns the updated ChatRoom entity.

func (*ChatRoomUpdateOne) SaveX

func (_u *ChatRoomUpdateOne) SaveX(ctx context.Context) *ChatRoom

SaveX is like Save, but panics if an error occurs.

func (*ChatRoomUpdateOne) Select

func (_u *ChatRoomUpdateOne) Select(field string, fields ...string) *ChatRoomUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ChatRoomUpdateOne) SetIsPublic

func (_u *ChatRoomUpdateOne) SetIsPublic(v bool) *ChatRoomUpdateOne

SetIsPublic sets the "is_public" field.

func (*ChatRoomUpdateOne) SetName

func (_u *ChatRoomUpdateOne) SetName(v string) *ChatRoomUpdateOne

SetName sets the "name" field.

func (*ChatRoomUpdateOne) SetNillableIsPublic

func (_u *ChatRoomUpdateOne) SetNillableIsPublic(v *bool) *ChatRoomUpdateOne

SetNillableIsPublic sets the "is_public" field if the given value is not nil.

func (*ChatRoomUpdateOne) SetNillableName

func (_u *ChatRoomUpdateOne) SetNillableName(v *string) *ChatRoomUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*ChatRoomUpdateOne) SetNillableOwnerID

func (_u *ChatRoomUpdateOne) SetNillableOwnerID(id *int) *ChatRoomUpdateOne

SetNillableOwnerID sets the "owner" edge to the User entity by ID if the given value is not nil.

func (*ChatRoomUpdateOne) SetNillablePasswordHash

func (_u *ChatRoomUpdateOne) SetNillablePasswordHash(v *string) *ChatRoomUpdateOne

SetNillablePasswordHash sets the "password_hash" field if the given value is not nil.

func (*ChatRoomUpdateOne) SetOwner

func (_u *ChatRoomUpdateOne) SetOwner(v *User) *ChatRoomUpdateOne

SetOwner sets the "owner" edge to the User entity.

func (*ChatRoomUpdateOne) SetOwnerID

func (_u *ChatRoomUpdateOne) SetOwnerID(id int) *ChatRoomUpdateOne

SetOwnerID sets the "owner" edge to the User entity by ID.

func (*ChatRoomUpdateOne) SetPasswordHash

func (_u *ChatRoomUpdateOne) SetPasswordHash(v string) *ChatRoomUpdateOne

SetPasswordHash sets the "password_hash" field.

func (*ChatRoomUpdateOne) Where

Where appends a list predicates to the ChatRoomUpdate builder.

type ChatRooms

type ChatRooms []*ChatRoom

ChatRooms is a parsable slice of ChatRoom.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// ChatBan is the client for interacting with the ChatBan builders.
	ChatBan *ChatBanClient
	// ChatMessage is the client for interacting with the ChatMessage builders.
	ChatMessage *ChatMessageClient
	// ChatRoom is the client for interacting with the ChatRoom builders.
	ChatRoom *ChatRoomClient
	// PasswordToken is the client for interacting with the PasswordToken builders.
	PasswordToken *PasswordTokenClient
	// PaymentCustomer is the client for interacting with the PaymentCustomer builders.
	PaymentCustomer *PaymentCustomerClient
	// PaymentIntent is the client for interacting with the PaymentIntent builders.
	PaymentIntent *PaymentIntentClient
	// PaymentMethod is the client for interacting with the PaymentMethod builders.
	PaymentMethod *PaymentMethodClient
	// Subscription is the client for interacting with the Subscription builders.
	Subscription *SubscriptionClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns a Client stored inside a context, or nil if there isn't one.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

func Open(driverName, dataSourceName string, options ...Option) (*Client, error)

Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.

func (*Client) BeginTx

func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection and prevents new queries from starting.

func (*Client) Debug

func (c *Client) Debug() *Client

Debug returns a new debug-client. It's used to get verbose logging on specific operations.

client.Debug().
	ChatBan.
	Query().
	Count(ctx)

func (*Client) Intercept

func (c *Client) Intercept(interceptors ...Interceptor)

Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.

func (*Client) Mutate

func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)

Mutate implements the ent.Mutator interface.

func (*Client) Tx

func (c *Client) Tx(ctx context.Context) (*Tx, error)

Tx returns a new transactional client. The provided context is used until the transaction is committed or rolled back.

func (*Client) Use

func (c *Client) Use(hooks ...Hook)

Use adds the mutation hooks to all the entity clients. In order to add hooks to a specific client, call: `client.Node.Use(...)`.

type CommitFunc

type CommitFunc func(context.Context, *Tx) error

The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.

func (CommitFunc) Commit

func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:

hook := func(next ent.Committer) ent.Committer {
	return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Commit(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Committer

type Committer interface {
	Commit(context.Context, *Tx) error
}

Committer is the interface that wraps the Commit method.

type ConstraintError

type ConstraintError struct {
	// contains filtered or unexported fields
}

ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

ent aliases to avoid import conflicts in user's code.

type Interceptor

type Interceptor = ent.Interceptor

ent aliases to avoid import conflicts in user's code.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

type NotLoadedError struct {
	// contains filtered or unexported fields
}

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

type NotSingularError struct {
	// contains filtered or unexported fields
}

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type PasswordToken

type PasswordToken struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Token holds the value of the "token" field.
	Token string `json:"-"`
	// UserID holds the value of the "user_id" field.
	UserID int `json:"user_id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PasswordTokenQuery when eager-loading is set.
	Edges PasswordTokenEdges `json:"edges"`
	// contains filtered or unexported fields
}

PasswordToken is the model entity for the PasswordToken schema.

func (*PasswordToken) QueryUser

func (_m *PasswordToken) QueryUser() *UserQuery

QueryUser queries the "user" edge of the PasswordToken entity.

func (*PasswordToken) String

func (_m *PasswordToken) String() string

String implements the fmt.Stringer.

func (*PasswordToken) Unwrap

func (_m *PasswordToken) Unwrap() *PasswordToken

Unwrap unwraps the PasswordToken entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*PasswordToken) Update

func (_m *PasswordToken) Update() *PasswordTokenUpdateOne

Update returns a builder for updating this PasswordToken. Note that you need to call PasswordToken.Unwrap() before calling this method if this PasswordToken was returned from a transaction, and the transaction was committed or rolled back.

func (*PasswordToken) Value

func (_m *PasswordToken) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the PasswordToken. This includes values selected through modifiers, order, etc.

type PasswordTokenClient

type PasswordTokenClient struct {
	// contains filtered or unexported fields
}

PasswordTokenClient is a client for the PasswordToken schema.

func NewPasswordTokenClient

func NewPasswordTokenClient(c config) *PasswordTokenClient

NewPasswordTokenClient returns a client for the PasswordToken from the given config.

func (*PasswordTokenClient) Create

Create returns a builder for creating a PasswordToken entity.

func (*PasswordTokenClient) CreateBulk

CreateBulk returns a builder for creating a bulk of PasswordToken entities.

func (*PasswordTokenClient) Delete

Delete returns a delete builder for PasswordToken.

func (*PasswordTokenClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PasswordTokenClient) DeleteOneID

func (c *PasswordTokenClient) DeleteOneID(id int) *PasswordTokenDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PasswordTokenClient) Get

Get returns a PasswordToken entity by its id.

func (*PasswordTokenClient) GetX

GetX is like Get, but panics if an error occurs.

func (*PasswordTokenClient) Hooks

func (c *PasswordTokenClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PasswordTokenClient) Intercept

func (c *PasswordTokenClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `passwordtoken.Intercept(f(g(h())))`.

func (*PasswordTokenClient) Interceptors

func (c *PasswordTokenClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PasswordTokenClient) MapCreateBulk

func (c *PasswordTokenClient) MapCreateBulk(slice any, setFunc func(*PasswordTokenCreate, int)) *PasswordTokenCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*PasswordTokenClient) Query

Query returns a query builder for PasswordToken.

func (*PasswordTokenClient) QueryUser

func (c *PasswordTokenClient) QueryUser(_m *PasswordToken) *UserQuery

QueryUser queries the user edge of a PasswordToken.

func (*PasswordTokenClient) Update

Update returns an update builder for PasswordToken.

func (*PasswordTokenClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*PasswordTokenClient) UpdateOneID

func (c *PasswordTokenClient) UpdateOneID(id int) *PasswordTokenUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PasswordTokenClient) Use

func (c *PasswordTokenClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `passwordtoken.Hooks(f(g(h())))`.

type PasswordTokenCreate

type PasswordTokenCreate struct {
	// contains filtered or unexported fields
}

PasswordTokenCreate is the builder for creating a PasswordToken entity.

func (*PasswordTokenCreate) Exec

func (_c *PasswordTokenCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PasswordTokenCreate) ExecX

func (_c *PasswordTokenCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PasswordTokenCreate) Mutation

Mutation returns the PasswordTokenMutation object of the builder.

func (*PasswordTokenCreate) Save

Save creates the PasswordToken in the database.

func (*PasswordTokenCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*PasswordTokenCreate) SetCreatedAt

func (_c *PasswordTokenCreate) SetCreatedAt(v time.Time) *PasswordTokenCreate

SetCreatedAt sets the "created_at" field.

func (*PasswordTokenCreate) SetNillableCreatedAt

func (_c *PasswordTokenCreate) SetNillableCreatedAt(v *time.Time) *PasswordTokenCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PasswordTokenCreate) SetToken

SetToken sets the "token" field.

func (*PasswordTokenCreate) SetUser

func (_c *PasswordTokenCreate) SetUser(v *User) *PasswordTokenCreate

SetUser sets the "user" edge to the User entity.

func (*PasswordTokenCreate) SetUserID

func (_c *PasswordTokenCreate) SetUserID(v int) *PasswordTokenCreate

SetUserID sets the "user_id" field.

type PasswordTokenCreateBulk

type PasswordTokenCreateBulk struct {
	// contains filtered or unexported fields
}

PasswordTokenCreateBulk is the builder for creating many PasswordToken entities in bulk.

func (*PasswordTokenCreateBulk) Exec

Exec executes the query.

func (*PasswordTokenCreateBulk) ExecX

func (_c *PasswordTokenCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PasswordTokenCreateBulk) Save

Save creates the PasswordToken entities in the database.

func (*PasswordTokenCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type PasswordTokenDelete

type PasswordTokenDelete struct {
	// contains filtered or unexported fields
}

PasswordTokenDelete is the builder for deleting a PasswordToken entity.

func (*PasswordTokenDelete) Exec

func (_d *PasswordTokenDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PasswordTokenDelete) ExecX

func (_d *PasswordTokenDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PasswordTokenDelete) Where

Where appends a list predicates to the PasswordTokenDelete builder.

type PasswordTokenDeleteOne

type PasswordTokenDeleteOne struct {
	// contains filtered or unexported fields
}

PasswordTokenDeleteOne is the builder for deleting a single PasswordToken entity.

func (*PasswordTokenDeleteOne) Exec

Exec executes the deletion query.

func (*PasswordTokenDeleteOne) ExecX

func (_d *PasswordTokenDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PasswordTokenDeleteOne) Where

Where appends a list predicates to the PasswordTokenDelete builder.

type PasswordTokenEdges

type PasswordTokenEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

PasswordTokenEdges holds the relations/edges for other nodes in the graph.

func (PasswordTokenEdges) UserOrErr

func (e PasswordTokenEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type PasswordTokenGroupBy

type PasswordTokenGroupBy struct {
	// contains filtered or unexported fields
}

PasswordTokenGroupBy is the group-by builder for PasswordToken entities.

func (*PasswordTokenGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*PasswordTokenGroupBy) Bool

func (s *PasswordTokenGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PasswordTokenGroupBy) BoolX

func (s *PasswordTokenGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PasswordTokenGroupBy) Bools

func (s *PasswordTokenGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PasswordTokenGroupBy) BoolsX

func (s *PasswordTokenGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PasswordTokenGroupBy) Float64

func (s *PasswordTokenGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PasswordTokenGroupBy) Float64X

func (s *PasswordTokenGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PasswordTokenGroupBy) Float64s

func (s *PasswordTokenGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PasswordTokenGroupBy) Float64sX

func (s *PasswordTokenGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PasswordTokenGroupBy) Int

func (s *PasswordTokenGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PasswordTokenGroupBy) IntX

func (s *PasswordTokenGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PasswordTokenGroupBy) Ints

func (s *PasswordTokenGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PasswordTokenGroupBy) IntsX

func (s *PasswordTokenGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PasswordTokenGroupBy) Scan

func (_g *PasswordTokenGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PasswordTokenGroupBy) ScanX

func (s *PasswordTokenGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PasswordTokenGroupBy) String

func (s *PasswordTokenGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PasswordTokenGroupBy) StringX

func (s *PasswordTokenGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PasswordTokenGroupBy) Strings

func (s *PasswordTokenGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PasswordTokenGroupBy) StringsX

func (s *PasswordTokenGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PasswordTokenMutation

type PasswordTokenMutation struct {
	// contains filtered or unexported fields
}

PasswordTokenMutation represents an operation that mutates the PasswordToken nodes in the graph.

func (*PasswordTokenMutation) AddField

func (m *PasswordTokenMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*PasswordTokenMutation) AddedEdges

func (m *PasswordTokenMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PasswordTokenMutation) AddedField

func (m *PasswordTokenMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*PasswordTokenMutation) AddedFields

func (m *PasswordTokenMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PasswordTokenMutation) AddedIDs

func (m *PasswordTokenMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PasswordTokenMutation) ClearEdge

func (m *PasswordTokenMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*PasswordTokenMutation) ClearField

func (m *PasswordTokenMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*PasswordTokenMutation) ClearUser

func (m *PasswordTokenMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*PasswordTokenMutation) ClearedEdges

func (m *PasswordTokenMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PasswordTokenMutation) ClearedFields

func (m *PasswordTokenMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PasswordTokenMutation) Client

func (m PasswordTokenMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*PasswordTokenMutation) CreatedAt

func (m *PasswordTokenMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*PasswordTokenMutation) EdgeCleared

func (m *PasswordTokenMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PasswordTokenMutation) Field

func (m *PasswordTokenMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*PasswordTokenMutation) FieldCleared

func (m *PasswordTokenMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PasswordTokenMutation) Fields

func (m *PasswordTokenMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*PasswordTokenMutation) ID

func (m *PasswordTokenMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*PasswordTokenMutation) IDs

func (m *PasswordTokenMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*PasswordTokenMutation) OldCreatedAt

func (m *PasswordTokenMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the PasswordToken entity. If the PasswordToken object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PasswordTokenMutation) OldField

func (m *PasswordTokenMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*PasswordTokenMutation) OldToken

func (m *PasswordTokenMutation) OldToken(ctx context.Context) (v string, err error)

OldToken returns the old "token" field's value of the PasswordToken entity. If the PasswordToken object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PasswordTokenMutation) OldUserID

func (m *PasswordTokenMutation) OldUserID(ctx context.Context) (v int, err error)

OldUserID returns the old "user_id" field's value of the PasswordToken entity. If the PasswordToken object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PasswordTokenMutation) Op

func (m *PasswordTokenMutation) Op() Op

Op returns the operation name.

func (*PasswordTokenMutation) RemovedEdges

func (m *PasswordTokenMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PasswordTokenMutation) RemovedIDs

func (m *PasswordTokenMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*PasswordTokenMutation) ResetCreatedAt

func (m *PasswordTokenMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PasswordTokenMutation) ResetEdge

func (m *PasswordTokenMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*PasswordTokenMutation) ResetField

func (m *PasswordTokenMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*PasswordTokenMutation) ResetToken

func (m *PasswordTokenMutation) ResetToken()

ResetToken resets all changes to the "token" field.

func (*PasswordTokenMutation) ResetUser

func (m *PasswordTokenMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*PasswordTokenMutation) ResetUserID

func (m *PasswordTokenMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*PasswordTokenMutation) SetCreatedAt

func (m *PasswordTokenMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*PasswordTokenMutation) SetField

func (m *PasswordTokenMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*PasswordTokenMutation) SetOp

func (m *PasswordTokenMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PasswordTokenMutation) SetToken

func (m *PasswordTokenMutation) SetToken(s string)

SetToken sets the "token" field.

func (*PasswordTokenMutation) SetUserID

func (m *PasswordTokenMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (*PasswordTokenMutation) Token

func (m *PasswordTokenMutation) Token() (r string, exists bool)

Token returns the value of the "token" field in the mutation.

func (PasswordTokenMutation) Tx

func (m PasswordTokenMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PasswordTokenMutation) Type

func (m *PasswordTokenMutation) Type() string

Type returns the node type of this mutation (PasswordToken).

func (*PasswordTokenMutation) UserCleared

func (m *PasswordTokenMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*PasswordTokenMutation) UserID

func (m *PasswordTokenMutation) UserID() (r int, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*PasswordTokenMutation) UserIDs

func (m *PasswordTokenMutation) UserIDs() (ids []int)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*PasswordTokenMutation) Where

Where appends a list predicates to the PasswordTokenMutation builder.

func (*PasswordTokenMutation) WhereP

func (m *PasswordTokenMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PasswordTokenMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PasswordTokenQuery

type PasswordTokenQuery struct {
	// contains filtered or unexported fields
}

PasswordTokenQuery is the builder for querying PasswordToken entities.

func (*PasswordTokenQuery) Aggregate

func (_q *PasswordTokenQuery) Aggregate(fns ...AggregateFunc) *PasswordTokenSelect

Aggregate returns a PasswordTokenSelect configured with the given aggregations.

func (*PasswordTokenQuery) All

All executes the query and returns a list of PasswordTokens.

func (*PasswordTokenQuery) AllX

AllX is like All, but panics if an error occurs.

func (*PasswordTokenQuery) Clone

Clone returns a duplicate of the PasswordTokenQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PasswordTokenQuery) Count

func (_q *PasswordTokenQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PasswordTokenQuery) CountX

func (_q *PasswordTokenQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PasswordTokenQuery) Exist

func (_q *PasswordTokenQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PasswordTokenQuery) ExistX

func (_q *PasswordTokenQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PasswordTokenQuery) First

First returns the first PasswordToken entity from the query. Returns a *NotFoundError when no PasswordToken was found.

func (*PasswordTokenQuery) FirstID

func (_q *PasswordTokenQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first PasswordToken ID from the query. Returns a *NotFoundError when no PasswordToken ID was found.

func (*PasswordTokenQuery) FirstIDX

func (_q *PasswordTokenQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*PasswordTokenQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*PasswordTokenQuery) GroupBy

func (_q *PasswordTokenQuery) GroupBy(field string, fields ...string) *PasswordTokenGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Token string `json:"token,omitempty"`
	Count int `json:"count,omitempty"`
}

client.PasswordToken.Query().
	GroupBy(passwordtoken.FieldToken).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PasswordTokenQuery) IDs

func (_q *PasswordTokenQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of PasswordToken IDs.

func (*PasswordTokenQuery) IDsX

func (_q *PasswordTokenQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*PasswordTokenQuery) Limit

func (_q *PasswordTokenQuery) Limit(limit int) *PasswordTokenQuery

Limit the number of records to be returned by this query.

func (*PasswordTokenQuery) Offset

func (_q *PasswordTokenQuery) Offset(offset int) *PasswordTokenQuery

Offset to start from.

func (*PasswordTokenQuery) Only

Only returns a single PasswordToken entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one PasswordToken entity is found. Returns a *NotFoundError when no PasswordToken entities are found.

func (*PasswordTokenQuery) OnlyID

func (_q *PasswordTokenQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only PasswordToken ID in the query. Returns a *NotSingularError when more than one PasswordToken ID is found. Returns a *NotFoundError when no entities are found.

func (*PasswordTokenQuery) OnlyIDX

func (_q *PasswordTokenQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PasswordTokenQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*PasswordTokenQuery) Order

Order specifies how the records should be ordered.

func (*PasswordTokenQuery) QueryUser

func (_q *PasswordTokenQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*PasswordTokenQuery) Select

func (_q *PasswordTokenQuery) Select(fields ...string) *PasswordTokenSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Token string `json:"token,omitempty"`
}

client.PasswordToken.Query().
	Select(passwordtoken.FieldToken).
	Scan(ctx, &v)

func (*PasswordTokenQuery) Unique

func (_q *PasswordTokenQuery) Unique(unique bool) *PasswordTokenQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*PasswordTokenQuery) Where

Where adds a new predicate for the PasswordTokenQuery builder.

func (*PasswordTokenQuery) WithUser

func (_q *PasswordTokenQuery) WithUser(opts ...func(*UserQuery)) *PasswordTokenQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type PasswordTokenSelect

type PasswordTokenSelect struct {
	*PasswordTokenQuery
	// contains filtered or unexported fields
}

PasswordTokenSelect is the builder for selecting fields of PasswordToken entities.

func (*PasswordTokenSelect) Aggregate

func (_s *PasswordTokenSelect) Aggregate(fns ...AggregateFunc) *PasswordTokenSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PasswordTokenSelect) Bool

func (s *PasswordTokenSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PasswordTokenSelect) BoolX

func (s *PasswordTokenSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PasswordTokenSelect) Bools

func (s *PasswordTokenSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PasswordTokenSelect) BoolsX

func (s *PasswordTokenSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PasswordTokenSelect) Float64

func (s *PasswordTokenSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PasswordTokenSelect) Float64X

func (s *PasswordTokenSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PasswordTokenSelect) Float64s

func (s *PasswordTokenSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PasswordTokenSelect) Float64sX

func (s *PasswordTokenSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PasswordTokenSelect) Int

func (s *PasswordTokenSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PasswordTokenSelect) IntX

func (s *PasswordTokenSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PasswordTokenSelect) Ints

func (s *PasswordTokenSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PasswordTokenSelect) IntsX

func (s *PasswordTokenSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PasswordTokenSelect) Scan

func (_s *PasswordTokenSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PasswordTokenSelect) ScanX

func (s *PasswordTokenSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PasswordTokenSelect) String

func (s *PasswordTokenSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PasswordTokenSelect) StringX

func (s *PasswordTokenSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PasswordTokenSelect) Strings

func (s *PasswordTokenSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PasswordTokenSelect) StringsX

func (s *PasswordTokenSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PasswordTokenUpdate

type PasswordTokenUpdate struct {
	// contains filtered or unexported fields
}

PasswordTokenUpdate is the builder for updating PasswordToken entities.

func (*PasswordTokenUpdate) ClearUser

func (_u *PasswordTokenUpdate) ClearUser() *PasswordTokenUpdate

ClearUser clears the "user" edge to the User entity.

func (*PasswordTokenUpdate) Exec

func (_u *PasswordTokenUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PasswordTokenUpdate) ExecX

func (_u *PasswordTokenUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PasswordTokenUpdate) Mutation

Mutation returns the PasswordTokenMutation object of the builder.

func (*PasswordTokenUpdate) Save

func (_u *PasswordTokenUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PasswordTokenUpdate) SaveX

func (_u *PasswordTokenUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PasswordTokenUpdate) SetCreatedAt

func (_u *PasswordTokenUpdate) SetCreatedAt(v time.Time) *PasswordTokenUpdate

SetCreatedAt sets the "created_at" field.

func (*PasswordTokenUpdate) SetNillableCreatedAt

func (_u *PasswordTokenUpdate) SetNillableCreatedAt(v *time.Time) *PasswordTokenUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PasswordTokenUpdate) SetNillableToken

func (_u *PasswordTokenUpdate) SetNillableToken(v *string) *PasswordTokenUpdate

SetNillableToken sets the "token" field if the given value is not nil.

func (*PasswordTokenUpdate) SetNillableUserID

func (_u *PasswordTokenUpdate) SetNillableUserID(v *int) *PasswordTokenUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*PasswordTokenUpdate) SetToken

SetToken sets the "token" field.

func (*PasswordTokenUpdate) SetUser

func (_u *PasswordTokenUpdate) SetUser(v *User) *PasswordTokenUpdate

SetUser sets the "user" edge to the User entity.

func (*PasswordTokenUpdate) SetUserID

func (_u *PasswordTokenUpdate) SetUserID(v int) *PasswordTokenUpdate

SetUserID sets the "user_id" field.

func (*PasswordTokenUpdate) Where

Where appends a list predicates to the PasswordTokenUpdate builder.

type PasswordTokenUpdateOne

type PasswordTokenUpdateOne struct {
	// contains filtered or unexported fields
}

PasswordTokenUpdateOne is the builder for updating a single PasswordToken entity.

func (*PasswordTokenUpdateOne) ClearUser

ClearUser clears the "user" edge to the User entity.

func (*PasswordTokenUpdateOne) Exec

Exec executes the query on the entity.

func (*PasswordTokenUpdateOne) ExecX

func (_u *PasswordTokenUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PasswordTokenUpdateOne) Mutation

Mutation returns the PasswordTokenMutation object of the builder.

func (*PasswordTokenUpdateOne) Save

Save executes the query and returns the updated PasswordToken entity.

func (*PasswordTokenUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*PasswordTokenUpdateOne) Select

func (_u *PasswordTokenUpdateOne) Select(field string, fields ...string) *PasswordTokenUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PasswordTokenUpdateOne) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*PasswordTokenUpdateOne) SetNillableCreatedAt

func (_u *PasswordTokenUpdateOne) SetNillableCreatedAt(v *time.Time) *PasswordTokenUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PasswordTokenUpdateOne) SetNillableToken

func (_u *PasswordTokenUpdateOne) SetNillableToken(v *string) *PasswordTokenUpdateOne

SetNillableToken sets the "token" field if the given value is not nil.

func (*PasswordTokenUpdateOne) SetNillableUserID

func (_u *PasswordTokenUpdateOne) SetNillableUserID(v *int) *PasswordTokenUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*PasswordTokenUpdateOne) SetToken

SetToken sets the "token" field.

func (*PasswordTokenUpdateOne) SetUser

SetUser sets the "user" edge to the User entity.

func (*PasswordTokenUpdateOne) SetUserID

SetUserID sets the "user_id" field.

func (*PasswordTokenUpdateOne) Where

Where appends a list predicates to the PasswordTokenUpdate builder.

type PasswordTokens

type PasswordTokens []*PasswordToken

PasswordTokens is a parsable slice of PasswordToken.

type PaymentCustomer

type PaymentCustomer struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// External payment provider customer ID (e.g., Stripe customer ID)
	ProviderCustomerID string `json:"provider_customer_id,omitempty"`
	// Payment provider name
	Provider string `json:"provider,omitempty"`
	// Customer email from payment provider
	Email string `json:"email,omitempty"`
	// Customer name from payment provider
	Name string `json:"name,omitempty"`
	// Additional customer data from payment provider
	Metadata map[string]interface{} `json:"metadata,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PaymentCustomerQuery when eager-loading is set.
	Edges PaymentCustomerEdges `json:"edges"`
	// contains filtered or unexported fields
}

PaymentCustomer is the model entity for the PaymentCustomer schema.

func (*PaymentCustomer) QueryPaymentIntents

func (_m *PaymentCustomer) QueryPaymentIntents() *PaymentIntentQuery

QueryPaymentIntents queries the "payment_intents" edge of the PaymentCustomer entity.

func (*PaymentCustomer) QueryPaymentMethods

func (_m *PaymentCustomer) QueryPaymentMethods() *PaymentMethodQuery

QueryPaymentMethods queries the "payment_methods" edge of the PaymentCustomer entity.

func (*PaymentCustomer) QuerySubscriptions

func (_m *PaymentCustomer) QuerySubscriptions() *SubscriptionQuery

QuerySubscriptions queries the "subscriptions" edge of the PaymentCustomer entity.

func (*PaymentCustomer) QueryUser

func (_m *PaymentCustomer) QueryUser() *UserQuery

QueryUser queries the "user" edge of the PaymentCustomer entity.

func (*PaymentCustomer) String

func (_m *PaymentCustomer) String() string

String implements the fmt.Stringer.

func (*PaymentCustomer) Unwrap

func (_m *PaymentCustomer) Unwrap() *PaymentCustomer

Unwrap unwraps the PaymentCustomer entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*PaymentCustomer) Update

Update returns a builder for updating this PaymentCustomer. Note that you need to call PaymentCustomer.Unwrap() before calling this method if this PaymentCustomer was returned from a transaction, and the transaction was committed or rolled back.

func (*PaymentCustomer) Value

func (_m *PaymentCustomer) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the PaymentCustomer. This includes values selected through modifiers, order, etc.

type PaymentCustomerClient

type PaymentCustomerClient struct {
	// contains filtered or unexported fields
}

PaymentCustomerClient is a client for the PaymentCustomer schema.

func NewPaymentCustomerClient

func NewPaymentCustomerClient(c config) *PaymentCustomerClient

NewPaymentCustomerClient returns a client for the PaymentCustomer from the given config.

func (*PaymentCustomerClient) Create

Create returns a builder for creating a PaymentCustomer entity.

func (*PaymentCustomerClient) CreateBulk

CreateBulk returns a builder for creating a bulk of PaymentCustomer entities.

func (*PaymentCustomerClient) Delete

Delete returns a delete builder for PaymentCustomer.

func (*PaymentCustomerClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PaymentCustomerClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PaymentCustomerClient) Get

Get returns a PaymentCustomer entity by its id.

func (*PaymentCustomerClient) GetX

GetX is like Get, but panics if an error occurs.

func (*PaymentCustomerClient) Hooks

func (c *PaymentCustomerClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PaymentCustomerClient) Intercept

func (c *PaymentCustomerClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `paymentcustomer.Intercept(f(g(h())))`.

func (*PaymentCustomerClient) Interceptors

func (c *PaymentCustomerClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PaymentCustomerClient) MapCreateBulk

func (c *PaymentCustomerClient) MapCreateBulk(slice any, setFunc func(*PaymentCustomerCreate, int)) *PaymentCustomerCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*PaymentCustomerClient) Query

Query returns a query builder for PaymentCustomer.

func (*PaymentCustomerClient) QueryPaymentIntents

func (c *PaymentCustomerClient) QueryPaymentIntents(_m *PaymentCustomer) *PaymentIntentQuery

QueryPaymentIntents queries the payment_intents edge of a PaymentCustomer.

func (*PaymentCustomerClient) QueryPaymentMethods

func (c *PaymentCustomerClient) QueryPaymentMethods(_m *PaymentCustomer) *PaymentMethodQuery

QueryPaymentMethods queries the payment_methods edge of a PaymentCustomer.

func (*PaymentCustomerClient) QuerySubscriptions

func (c *PaymentCustomerClient) QuerySubscriptions(_m *PaymentCustomer) *SubscriptionQuery

QuerySubscriptions queries the subscriptions edge of a PaymentCustomer.

func (*PaymentCustomerClient) QueryUser

func (c *PaymentCustomerClient) QueryUser(_m *PaymentCustomer) *UserQuery

QueryUser queries the user edge of a PaymentCustomer.

func (*PaymentCustomerClient) Update

Update returns an update builder for PaymentCustomer.

func (*PaymentCustomerClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*PaymentCustomerClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*PaymentCustomerClient) Use

func (c *PaymentCustomerClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `paymentcustomer.Hooks(f(g(h())))`.

type PaymentCustomerCreate

type PaymentCustomerCreate struct {
	// contains filtered or unexported fields
}

PaymentCustomerCreate is the builder for creating a PaymentCustomer entity.

func (*PaymentCustomerCreate) AddPaymentIntentIDs

func (_c *PaymentCustomerCreate) AddPaymentIntentIDs(ids ...int) *PaymentCustomerCreate

AddPaymentIntentIDs adds the "payment_intents" edge to the PaymentIntent entity by IDs.

func (*PaymentCustomerCreate) AddPaymentIntents

func (_c *PaymentCustomerCreate) AddPaymentIntents(v ...*PaymentIntent) *PaymentCustomerCreate

AddPaymentIntents adds the "payment_intents" edges to the PaymentIntent entity.

func (*PaymentCustomerCreate) AddPaymentMethodIDs

func (_c *PaymentCustomerCreate) AddPaymentMethodIDs(ids ...int) *PaymentCustomerCreate

AddPaymentMethodIDs adds the "payment_methods" edge to the PaymentMethod entity by IDs.

func (*PaymentCustomerCreate) AddPaymentMethods

func (_c *PaymentCustomerCreate) AddPaymentMethods(v ...*PaymentMethod) *PaymentCustomerCreate

AddPaymentMethods adds the "payment_methods" edges to the PaymentMethod entity.

func (*PaymentCustomerCreate) AddSubscriptionIDs

func (_c *PaymentCustomerCreate) AddSubscriptionIDs(ids ...int) *PaymentCustomerCreate

AddSubscriptionIDs adds the "subscriptions" edge to the Subscription entity by IDs.

func (*PaymentCustomerCreate) AddSubscriptions

func (_c *PaymentCustomerCreate) AddSubscriptions(v ...*Subscription) *PaymentCustomerCreate

AddSubscriptions adds the "subscriptions" edges to the Subscription entity.

func (*PaymentCustomerCreate) Exec

Exec executes the query.

func (*PaymentCustomerCreate) ExecX

func (_c *PaymentCustomerCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PaymentCustomerCreate) Mutation

Mutation returns the PaymentCustomerMutation object of the builder.

func (*PaymentCustomerCreate) Save

Save creates the PaymentCustomer in the database.

func (*PaymentCustomerCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*PaymentCustomerCreate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*PaymentCustomerCreate) SetEmail

SetEmail sets the "email" field.

func (*PaymentCustomerCreate) SetMetadata

func (_c *PaymentCustomerCreate) SetMetadata(v map[string]interface{}) *PaymentCustomerCreate

SetMetadata sets the "metadata" field.

func (*PaymentCustomerCreate) SetName

SetName sets the "name" field.

func (*PaymentCustomerCreate) SetNillableCreatedAt

func (_c *PaymentCustomerCreate) SetNillableCreatedAt(v *time.Time) *PaymentCustomerCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PaymentCustomerCreate) SetNillableName

func (_c *PaymentCustomerCreate) SetNillableName(v *string) *PaymentCustomerCreate

SetNillableName sets the "name" field if the given value is not nil.

func (*PaymentCustomerCreate) SetNillableProvider

func (_c *PaymentCustomerCreate) SetNillableProvider(v *string) *PaymentCustomerCreate

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*PaymentCustomerCreate) SetNillableUpdatedAt

func (_c *PaymentCustomerCreate) SetNillableUpdatedAt(v *time.Time) *PaymentCustomerCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*PaymentCustomerCreate) SetProvider

SetProvider sets the "provider" field.

func (*PaymentCustomerCreate) SetProviderCustomerID

func (_c *PaymentCustomerCreate) SetProviderCustomerID(v string) *PaymentCustomerCreate

SetProviderCustomerID sets the "provider_customer_id" field.

func (*PaymentCustomerCreate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*PaymentCustomerCreate) SetUser

SetUser sets the "user" edge to the User entity.

func (*PaymentCustomerCreate) SetUserID

func (_c *PaymentCustomerCreate) SetUserID(id int) *PaymentCustomerCreate

SetUserID sets the "user" edge to the User entity by ID.

type PaymentCustomerCreateBulk

type PaymentCustomerCreateBulk struct {
	// contains filtered or unexported fields
}

PaymentCustomerCreateBulk is the builder for creating many PaymentCustomer entities in bulk.

func (*PaymentCustomerCreateBulk) Exec

Exec executes the query.

func (*PaymentCustomerCreateBulk) ExecX

func (_c *PaymentCustomerCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PaymentCustomerCreateBulk) Save

Save creates the PaymentCustomer entities in the database.

func (*PaymentCustomerCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type PaymentCustomerDelete

type PaymentCustomerDelete struct {
	// contains filtered or unexported fields
}

PaymentCustomerDelete is the builder for deleting a PaymentCustomer entity.

func (*PaymentCustomerDelete) Exec

func (_d *PaymentCustomerDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PaymentCustomerDelete) ExecX

func (_d *PaymentCustomerDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PaymentCustomerDelete) Where

Where appends a list predicates to the PaymentCustomerDelete builder.

type PaymentCustomerDeleteOne

type PaymentCustomerDeleteOne struct {
	// contains filtered or unexported fields
}

PaymentCustomerDeleteOne is the builder for deleting a single PaymentCustomer entity.

func (*PaymentCustomerDeleteOne) Exec

Exec executes the deletion query.

func (*PaymentCustomerDeleteOne) ExecX

func (_d *PaymentCustomerDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PaymentCustomerDeleteOne) Where

Where appends a list predicates to the PaymentCustomerDelete builder.

type PaymentCustomerEdges

type PaymentCustomerEdges struct {
	// User associated with this payment customer
	User *User `json:"user,omitempty"`
	// Payment intents for this customer
	PaymentIntents []*PaymentIntent `json:"payment_intents,omitempty"`
	// Subscriptions for this customer
	Subscriptions []*Subscription `json:"subscriptions,omitempty"`
	// Payment methods for this customer
	PaymentMethods []*PaymentMethod `json:"payment_methods,omitempty"`
	// contains filtered or unexported fields
}

PaymentCustomerEdges holds the relations/edges for other nodes in the graph.

func (PaymentCustomerEdges) PaymentIntentsOrErr

func (e PaymentCustomerEdges) PaymentIntentsOrErr() ([]*PaymentIntent, error)

PaymentIntentsOrErr returns the PaymentIntents value or an error if the edge was not loaded in eager-loading.

func (PaymentCustomerEdges) PaymentMethodsOrErr

func (e PaymentCustomerEdges) PaymentMethodsOrErr() ([]*PaymentMethod, error)

PaymentMethodsOrErr returns the PaymentMethods value or an error if the edge was not loaded in eager-loading.

func (PaymentCustomerEdges) SubscriptionsOrErr

func (e PaymentCustomerEdges) SubscriptionsOrErr() ([]*Subscription, error)

SubscriptionsOrErr returns the Subscriptions value or an error if the edge was not loaded in eager-loading.

func (PaymentCustomerEdges) UserOrErr

func (e PaymentCustomerEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type PaymentCustomerGroupBy

type PaymentCustomerGroupBy struct {
	// contains filtered or unexported fields
}

PaymentCustomerGroupBy is the group-by builder for PaymentCustomer entities.

func (*PaymentCustomerGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*PaymentCustomerGroupBy) Bool

func (s *PaymentCustomerGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PaymentCustomerGroupBy) BoolX

func (s *PaymentCustomerGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PaymentCustomerGroupBy) Bools

func (s *PaymentCustomerGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PaymentCustomerGroupBy) BoolsX

func (s *PaymentCustomerGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PaymentCustomerGroupBy) Float64

func (s *PaymentCustomerGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PaymentCustomerGroupBy) Float64X

func (s *PaymentCustomerGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PaymentCustomerGroupBy) Float64s

func (s *PaymentCustomerGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PaymentCustomerGroupBy) Float64sX

func (s *PaymentCustomerGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PaymentCustomerGroupBy) Int

func (s *PaymentCustomerGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PaymentCustomerGroupBy) IntX

func (s *PaymentCustomerGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PaymentCustomerGroupBy) Ints

func (s *PaymentCustomerGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PaymentCustomerGroupBy) IntsX

func (s *PaymentCustomerGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PaymentCustomerGroupBy) Scan

func (_g *PaymentCustomerGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PaymentCustomerGroupBy) ScanX

func (s *PaymentCustomerGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PaymentCustomerGroupBy) String

func (s *PaymentCustomerGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PaymentCustomerGroupBy) StringX

func (s *PaymentCustomerGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PaymentCustomerGroupBy) Strings

func (s *PaymentCustomerGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PaymentCustomerGroupBy) StringsX

func (s *PaymentCustomerGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PaymentCustomerMutation

type PaymentCustomerMutation struct {
	// contains filtered or unexported fields
}

PaymentCustomerMutation represents an operation that mutates the PaymentCustomer nodes in the graph.

func (*PaymentCustomerMutation) AddField

func (m *PaymentCustomerMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*PaymentCustomerMutation) AddPaymentIntentIDs

func (m *PaymentCustomerMutation) AddPaymentIntentIDs(ids ...int)

AddPaymentIntentIDs adds the "payment_intents" edge to the PaymentIntent entity by ids.

func (*PaymentCustomerMutation) AddPaymentMethodIDs

func (m *PaymentCustomerMutation) AddPaymentMethodIDs(ids ...int)

AddPaymentMethodIDs adds the "payment_methods" edge to the PaymentMethod entity by ids.

func (*PaymentCustomerMutation) AddSubscriptionIDs

func (m *PaymentCustomerMutation) AddSubscriptionIDs(ids ...int)

AddSubscriptionIDs adds the "subscriptions" edge to the Subscription entity by ids.

func (*PaymentCustomerMutation) AddedEdges

func (m *PaymentCustomerMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PaymentCustomerMutation) AddedField

func (m *PaymentCustomerMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*PaymentCustomerMutation) AddedFields

func (m *PaymentCustomerMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PaymentCustomerMutation) AddedIDs

func (m *PaymentCustomerMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PaymentCustomerMutation) ClearEdge

func (m *PaymentCustomerMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*PaymentCustomerMutation) ClearField

func (m *PaymentCustomerMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*PaymentCustomerMutation) ClearMetadata

func (m *PaymentCustomerMutation) ClearMetadata()

ClearMetadata clears the value of the "metadata" field.

func (*PaymentCustomerMutation) ClearName

func (m *PaymentCustomerMutation) ClearName()

ClearName clears the value of the "name" field.

func (*PaymentCustomerMutation) ClearPaymentIntents

func (m *PaymentCustomerMutation) ClearPaymentIntents()

ClearPaymentIntents clears the "payment_intents" edge to the PaymentIntent entity.

func (*PaymentCustomerMutation) ClearPaymentMethods

func (m *PaymentCustomerMutation) ClearPaymentMethods()

ClearPaymentMethods clears the "payment_methods" edge to the PaymentMethod entity.

func (*PaymentCustomerMutation) ClearSubscriptions

func (m *PaymentCustomerMutation) ClearSubscriptions()

ClearSubscriptions clears the "subscriptions" edge to the Subscription entity.

func (*PaymentCustomerMutation) ClearUser

func (m *PaymentCustomerMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*PaymentCustomerMutation) ClearedEdges

func (m *PaymentCustomerMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PaymentCustomerMutation) ClearedFields

func (m *PaymentCustomerMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PaymentCustomerMutation) Client

func (m PaymentCustomerMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*PaymentCustomerMutation) CreatedAt

func (m *PaymentCustomerMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*PaymentCustomerMutation) EdgeCleared

func (m *PaymentCustomerMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PaymentCustomerMutation) Email

func (m *PaymentCustomerMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*PaymentCustomerMutation) Field

func (m *PaymentCustomerMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*PaymentCustomerMutation) FieldCleared

func (m *PaymentCustomerMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PaymentCustomerMutation) Fields

func (m *PaymentCustomerMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*PaymentCustomerMutation) ID

func (m *PaymentCustomerMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*PaymentCustomerMutation) IDs

func (m *PaymentCustomerMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*PaymentCustomerMutation) Metadata

func (m *PaymentCustomerMutation) Metadata() (r map[string]interface{}, exists bool)

Metadata returns the value of the "metadata" field in the mutation.

func (*PaymentCustomerMutation) MetadataCleared

func (m *PaymentCustomerMutation) MetadataCleared() bool

MetadataCleared returns if the "metadata" field was cleared in this mutation.

func (*PaymentCustomerMutation) Name

func (m *PaymentCustomerMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*PaymentCustomerMutation) NameCleared

func (m *PaymentCustomerMutation) NameCleared() bool

NameCleared returns if the "name" field was cleared in this mutation.

func (*PaymentCustomerMutation) OldCreatedAt

func (m *PaymentCustomerMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the PaymentCustomer entity. If the PaymentCustomer object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentCustomerMutation) OldEmail

func (m *PaymentCustomerMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the PaymentCustomer entity. If the PaymentCustomer object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentCustomerMutation) OldField

func (m *PaymentCustomerMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*PaymentCustomerMutation) OldMetadata

func (m *PaymentCustomerMutation) OldMetadata(ctx context.Context) (v map[string]interface{}, err error)

OldMetadata returns the old "metadata" field's value of the PaymentCustomer entity. If the PaymentCustomer object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentCustomerMutation) OldName

func (m *PaymentCustomerMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the PaymentCustomer entity. If the PaymentCustomer object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentCustomerMutation) OldProvider

func (m *PaymentCustomerMutation) OldProvider(ctx context.Context) (v string, err error)

OldProvider returns the old "provider" field's value of the PaymentCustomer entity. If the PaymentCustomer object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentCustomerMutation) OldProviderCustomerID

func (m *PaymentCustomerMutation) OldProviderCustomerID(ctx context.Context) (v string, err error)

OldProviderCustomerID returns the old "provider_customer_id" field's value of the PaymentCustomer entity. If the PaymentCustomer object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentCustomerMutation) OldUpdatedAt

func (m *PaymentCustomerMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the PaymentCustomer entity. If the PaymentCustomer object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentCustomerMutation) Op

func (m *PaymentCustomerMutation) Op() Op

Op returns the operation name.

func (*PaymentCustomerMutation) PaymentIntentsCleared

func (m *PaymentCustomerMutation) PaymentIntentsCleared() bool

PaymentIntentsCleared reports if the "payment_intents" edge to the PaymentIntent entity was cleared.

func (*PaymentCustomerMutation) PaymentIntentsIDs

func (m *PaymentCustomerMutation) PaymentIntentsIDs() (ids []int)

PaymentIntentsIDs returns the "payment_intents" edge IDs in the mutation.

func (*PaymentCustomerMutation) PaymentMethodsCleared

func (m *PaymentCustomerMutation) PaymentMethodsCleared() bool

PaymentMethodsCleared reports if the "payment_methods" edge to the PaymentMethod entity was cleared.

func (*PaymentCustomerMutation) PaymentMethodsIDs

func (m *PaymentCustomerMutation) PaymentMethodsIDs() (ids []int)

PaymentMethodsIDs returns the "payment_methods" edge IDs in the mutation.

func (*PaymentCustomerMutation) Provider

func (m *PaymentCustomerMutation) Provider() (r string, exists bool)

Provider returns the value of the "provider" field in the mutation.

func (*PaymentCustomerMutation) ProviderCustomerID

func (m *PaymentCustomerMutation) ProviderCustomerID() (r string, exists bool)

ProviderCustomerID returns the value of the "provider_customer_id" field in the mutation.

func (*PaymentCustomerMutation) RemovePaymentIntentIDs

func (m *PaymentCustomerMutation) RemovePaymentIntentIDs(ids ...int)

RemovePaymentIntentIDs removes the "payment_intents" edge to the PaymentIntent entity by IDs.

func (*PaymentCustomerMutation) RemovePaymentMethodIDs

func (m *PaymentCustomerMutation) RemovePaymentMethodIDs(ids ...int)

RemovePaymentMethodIDs removes the "payment_methods" edge to the PaymentMethod entity by IDs.

func (*PaymentCustomerMutation) RemoveSubscriptionIDs

func (m *PaymentCustomerMutation) RemoveSubscriptionIDs(ids ...int)

RemoveSubscriptionIDs removes the "subscriptions" edge to the Subscription entity by IDs.

func (*PaymentCustomerMutation) RemovedEdges

func (m *PaymentCustomerMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PaymentCustomerMutation) RemovedIDs

func (m *PaymentCustomerMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*PaymentCustomerMutation) RemovedPaymentIntentsIDs

func (m *PaymentCustomerMutation) RemovedPaymentIntentsIDs() (ids []int)

RemovedPaymentIntents returns the removed IDs of the "payment_intents" edge to the PaymentIntent entity.

func (*PaymentCustomerMutation) RemovedPaymentMethodsIDs

func (m *PaymentCustomerMutation) RemovedPaymentMethodsIDs() (ids []int)

RemovedPaymentMethods returns the removed IDs of the "payment_methods" edge to the PaymentMethod entity.

func (*PaymentCustomerMutation) RemovedSubscriptionsIDs

func (m *PaymentCustomerMutation) RemovedSubscriptionsIDs() (ids []int)

RemovedSubscriptions returns the removed IDs of the "subscriptions" edge to the Subscription entity.

func (*PaymentCustomerMutation) ResetCreatedAt

func (m *PaymentCustomerMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PaymentCustomerMutation) ResetEdge

func (m *PaymentCustomerMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*PaymentCustomerMutation) ResetEmail

func (m *PaymentCustomerMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*PaymentCustomerMutation) ResetField

func (m *PaymentCustomerMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*PaymentCustomerMutation) ResetMetadata

func (m *PaymentCustomerMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" field.

func (*PaymentCustomerMutation) ResetName

func (m *PaymentCustomerMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*PaymentCustomerMutation) ResetPaymentIntents

func (m *PaymentCustomerMutation) ResetPaymentIntents()

ResetPaymentIntents resets all changes to the "payment_intents" edge.

func (*PaymentCustomerMutation) ResetPaymentMethods

func (m *PaymentCustomerMutation) ResetPaymentMethods()

ResetPaymentMethods resets all changes to the "payment_methods" edge.

func (*PaymentCustomerMutation) ResetProvider

func (m *PaymentCustomerMutation) ResetProvider()

ResetProvider resets all changes to the "provider" field.

func (*PaymentCustomerMutation) ResetProviderCustomerID

func (m *PaymentCustomerMutation) ResetProviderCustomerID()

ResetProviderCustomerID resets all changes to the "provider_customer_id" field.

func (*PaymentCustomerMutation) ResetSubscriptions

func (m *PaymentCustomerMutation) ResetSubscriptions()

ResetSubscriptions resets all changes to the "subscriptions" edge.

func (*PaymentCustomerMutation) ResetUpdatedAt

func (m *PaymentCustomerMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*PaymentCustomerMutation) ResetUser

func (m *PaymentCustomerMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*PaymentCustomerMutation) SetCreatedAt

func (m *PaymentCustomerMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*PaymentCustomerMutation) SetEmail

func (m *PaymentCustomerMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*PaymentCustomerMutation) SetField

func (m *PaymentCustomerMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*PaymentCustomerMutation) SetMetadata

func (m *PaymentCustomerMutation) SetMetadata(value map[string]interface{})

SetMetadata sets the "metadata" field.

func (*PaymentCustomerMutation) SetName

func (m *PaymentCustomerMutation) SetName(s string)

SetName sets the "name" field.

func (*PaymentCustomerMutation) SetOp

func (m *PaymentCustomerMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PaymentCustomerMutation) SetProvider

func (m *PaymentCustomerMutation) SetProvider(s string)

SetProvider sets the "provider" field.

func (*PaymentCustomerMutation) SetProviderCustomerID

func (m *PaymentCustomerMutation) SetProviderCustomerID(s string)

SetProviderCustomerID sets the "provider_customer_id" field.

func (*PaymentCustomerMutation) SetUpdatedAt

func (m *PaymentCustomerMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*PaymentCustomerMutation) SetUserID

func (m *PaymentCustomerMutation) SetUserID(id int)

SetUserID sets the "user" edge to the User entity by id.

func (*PaymentCustomerMutation) SubscriptionsCleared

func (m *PaymentCustomerMutation) SubscriptionsCleared() bool

SubscriptionsCleared reports if the "subscriptions" edge to the Subscription entity was cleared.

func (*PaymentCustomerMutation) SubscriptionsIDs

func (m *PaymentCustomerMutation) SubscriptionsIDs() (ids []int)

SubscriptionsIDs returns the "subscriptions" edge IDs in the mutation.

func (PaymentCustomerMutation) Tx

func (m PaymentCustomerMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PaymentCustomerMutation) Type

func (m *PaymentCustomerMutation) Type() string

Type returns the node type of this mutation (PaymentCustomer).

func (*PaymentCustomerMutation) UpdatedAt

func (m *PaymentCustomerMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*PaymentCustomerMutation) UserCleared

func (m *PaymentCustomerMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*PaymentCustomerMutation) UserID

func (m *PaymentCustomerMutation) UserID() (id int, exists bool)

UserID returns the "user" edge ID in the mutation.

func (*PaymentCustomerMutation) UserIDs

func (m *PaymentCustomerMutation) UserIDs() (ids []int)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*PaymentCustomerMutation) Where

Where appends a list predicates to the PaymentCustomerMutation builder.

func (*PaymentCustomerMutation) WhereP

func (m *PaymentCustomerMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PaymentCustomerMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PaymentCustomerQuery

type PaymentCustomerQuery struct {
	// contains filtered or unexported fields
}

PaymentCustomerQuery is the builder for querying PaymentCustomer entities.

func (*PaymentCustomerQuery) Aggregate

Aggregate returns a PaymentCustomerSelect configured with the given aggregations.

func (*PaymentCustomerQuery) All

All executes the query and returns a list of PaymentCustomers.

func (*PaymentCustomerQuery) AllX

AllX is like All, but panics if an error occurs.

func (*PaymentCustomerQuery) Clone

Clone returns a duplicate of the PaymentCustomerQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PaymentCustomerQuery) Count

func (_q *PaymentCustomerQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PaymentCustomerQuery) CountX

func (_q *PaymentCustomerQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PaymentCustomerQuery) Exist

func (_q *PaymentCustomerQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PaymentCustomerQuery) ExistX

func (_q *PaymentCustomerQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PaymentCustomerQuery) First

First returns the first PaymentCustomer entity from the query. Returns a *NotFoundError when no PaymentCustomer was found.

func (*PaymentCustomerQuery) FirstID

func (_q *PaymentCustomerQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first PaymentCustomer ID from the query. Returns a *NotFoundError when no PaymentCustomer ID was found.

func (*PaymentCustomerQuery) FirstIDX

func (_q *PaymentCustomerQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*PaymentCustomerQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*PaymentCustomerQuery) GroupBy

func (_q *PaymentCustomerQuery) GroupBy(field string, fields ...string) *PaymentCustomerGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	ProviderCustomerID string `json:"provider_customer_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.PaymentCustomer.Query().
	GroupBy(paymentcustomer.FieldProviderCustomerID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PaymentCustomerQuery) IDs

func (_q *PaymentCustomerQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of PaymentCustomer IDs.

func (*PaymentCustomerQuery) IDsX

func (_q *PaymentCustomerQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*PaymentCustomerQuery) Limit

func (_q *PaymentCustomerQuery) Limit(limit int) *PaymentCustomerQuery

Limit the number of records to be returned by this query.

func (*PaymentCustomerQuery) Offset

func (_q *PaymentCustomerQuery) Offset(offset int) *PaymentCustomerQuery

Offset to start from.

func (*PaymentCustomerQuery) Only

Only returns a single PaymentCustomer entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one PaymentCustomer entity is found. Returns a *NotFoundError when no PaymentCustomer entities are found.

func (*PaymentCustomerQuery) OnlyID

func (_q *PaymentCustomerQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only PaymentCustomer ID in the query. Returns a *NotSingularError when more than one PaymentCustomer ID is found. Returns a *NotFoundError when no entities are found.

func (*PaymentCustomerQuery) OnlyIDX

func (_q *PaymentCustomerQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PaymentCustomerQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*PaymentCustomerQuery) Order

Order specifies how the records should be ordered.

func (*PaymentCustomerQuery) QueryPaymentIntents

func (_q *PaymentCustomerQuery) QueryPaymentIntents() *PaymentIntentQuery

QueryPaymentIntents chains the current query on the "payment_intents" edge.

func (*PaymentCustomerQuery) QueryPaymentMethods

func (_q *PaymentCustomerQuery) QueryPaymentMethods() *PaymentMethodQuery

QueryPaymentMethods chains the current query on the "payment_methods" edge.

func (*PaymentCustomerQuery) QuerySubscriptions

func (_q *PaymentCustomerQuery) QuerySubscriptions() *SubscriptionQuery

QuerySubscriptions chains the current query on the "subscriptions" edge.

func (*PaymentCustomerQuery) QueryUser

func (_q *PaymentCustomerQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*PaymentCustomerQuery) Select

func (_q *PaymentCustomerQuery) Select(fields ...string) *PaymentCustomerSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	ProviderCustomerID string `json:"provider_customer_id,omitempty"`
}

client.PaymentCustomer.Query().
	Select(paymentcustomer.FieldProviderCustomerID).
	Scan(ctx, &v)

func (*PaymentCustomerQuery) Unique

func (_q *PaymentCustomerQuery) Unique(unique bool) *PaymentCustomerQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*PaymentCustomerQuery) Where

Where adds a new predicate for the PaymentCustomerQuery builder.

func (*PaymentCustomerQuery) WithPaymentIntents

func (_q *PaymentCustomerQuery) WithPaymentIntents(opts ...func(*PaymentIntentQuery)) *PaymentCustomerQuery

WithPaymentIntents tells the query-builder to eager-load the nodes that are connected to the "payment_intents" edge. The optional arguments are used to configure the query builder of the edge.

func (*PaymentCustomerQuery) WithPaymentMethods

func (_q *PaymentCustomerQuery) WithPaymentMethods(opts ...func(*PaymentMethodQuery)) *PaymentCustomerQuery

WithPaymentMethods tells the query-builder to eager-load the nodes that are connected to the "payment_methods" edge. The optional arguments are used to configure the query builder of the edge.

func (*PaymentCustomerQuery) WithSubscriptions

func (_q *PaymentCustomerQuery) WithSubscriptions(opts ...func(*SubscriptionQuery)) *PaymentCustomerQuery

WithSubscriptions tells the query-builder to eager-load the nodes that are connected to the "subscriptions" edge. The optional arguments are used to configure the query builder of the edge.

func (*PaymentCustomerQuery) WithUser

func (_q *PaymentCustomerQuery) WithUser(opts ...func(*UserQuery)) *PaymentCustomerQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type PaymentCustomerSelect

type PaymentCustomerSelect struct {
	*PaymentCustomerQuery
	// contains filtered or unexported fields
}

PaymentCustomerSelect is the builder for selecting fields of PaymentCustomer entities.

func (*PaymentCustomerSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*PaymentCustomerSelect) Bool

func (s *PaymentCustomerSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PaymentCustomerSelect) BoolX

func (s *PaymentCustomerSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PaymentCustomerSelect) Bools

func (s *PaymentCustomerSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PaymentCustomerSelect) BoolsX

func (s *PaymentCustomerSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PaymentCustomerSelect) Float64

func (s *PaymentCustomerSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PaymentCustomerSelect) Float64X

func (s *PaymentCustomerSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PaymentCustomerSelect) Float64s

func (s *PaymentCustomerSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PaymentCustomerSelect) Float64sX

func (s *PaymentCustomerSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PaymentCustomerSelect) Int

func (s *PaymentCustomerSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PaymentCustomerSelect) IntX

func (s *PaymentCustomerSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PaymentCustomerSelect) Ints

func (s *PaymentCustomerSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PaymentCustomerSelect) IntsX

func (s *PaymentCustomerSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PaymentCustomerSelect) Scan

func (_s *PaymentCustomerSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PaymentCustomerSelect) ScanX

func (s *PaymentCustomerSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PaymentCustomerSelect) String

func (s *PaymentCustomerSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PaymentCustomerSelect) StringX

func (s *PaymentCustomerSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PaymentCustomerSelect) Strings

func (s *PaymentCustomerSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PaymentCustomerSelect) StringsX

func (s *PaymentCustomerSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PaymentCustomerUpdate

type PaymentCustomerUpdate struct {
	// contains filtered or unexported fields
}

PaymentCustomerUpdate is the builder for updating PaymentCustomer entities.

func (*PaymentCustomerUpdate) AddPaymentIntentIDs

func (_u *PaymentCustomerUpdate) AddPaymentIntentIDs(ids ...int) *PaymentCustomerUpdate

AddPaymentIntentIDs adds the "payment_intents" edge to the PaymentIntent entity by IDs.

func (*PaymentCustomerUpdate) AddPaymentIntents

func (_u *PaymentCustomerUpdate) AddPaymentIntents(v ...*PaymentIntent) *PaymentCustomerUpdate

AddPaymentIntents adds the "payment_intents" edges to the PaymentIntent entity.

func (*PaymentCustomerUpdate) AddPaymentMethodIDs

func (_u *PaymentCustomerUpdate) AddPaymentMethodIDs(ids ...int) *PaymentCustomerUpdate

AddPaymentMethodIDs adds the "payment_methods" edge to the PaymentMethod entity by IDs.

func (*PaymentCustomerUpdate) AddPaymentMethods

func (_u *PaymentCustomerUpdate) AddPaymentMethods(v ...*PaymentMethod) *PaymentCustomerUpdate

AddPaymentMethods adds the "payment_methods" edges to the PaymentMethod entity.

func (*PaymentCustomerUpdate) AddSubscriptionIDs

func (_u *PaymentCustomerUpdate) AddSubscriptionIDs(ids ...int) *PaymentCustomerUpdate

AddSubscriptionIDs adds the "subscriptions" edge to the Subscription entity by IDs.

func (*PaymentCustomerUpdate) AddSubscriptions

func (_u *PaymentCustomerUpdate) AddSubscriptions(v ...*Subscription) *PaymentCustomerUpdate

AddSubscriptions adds the "subscriptions" edges to the Subscription entity.

func (*PaymentCustomerUpdate) ClearMetadata

func (_u *PaymentCustomerUpdate) ClearMetadata() *PaymentCustomerUpdate

ClearMetadata clears the value of the "metadata" field.

func (*PaymentCustomerUpdate) ClearName

ClearName clears the value of the "name" field.

func (*PaymentCustomerUpdate) ClearPaymentIntents

func (_u *PaymentCustomerUpdate) ClearPaymentIntents() *PaymentCustomerUpdate

ClearPaymentIntents clears all "payment_intents" edges to the PaymentIntent entity.

func (*PaymentCustomerUpdate) ClearPaymentMethods

func (_u *PaymentCustomerUpdate) ClearPaymentMethods() *PaymentCustomerUpdate

ClearPaymentMethods clears all "payment_methods" edges to the PaymentMethod entity.

func (*PaymentCustomerUpdate) ClearSubscriptions

func (_u *PaymentCustomerUpdate) ClearSubscriptions() *PaymentCustomerUpdate

ClearSubscriptions clears all "subscriptions" edges to the Subscription entity.

func (*PaymentCustomerUpdate) ClearUser

ClearUser clears the "user" edge to the User entity.

func (*PaymentCustomerUpdate) Exec

Exec executes the query.

func (*PaymentCustomerUpdate) ExecX

func (_u *PaymentCustomerUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PaymentCustomerUpdate) Mutation

Mutation returns the PaymentCustomerMutation object of the builder.

func (*PaymentCustomerUpdate) RemovePaymentIntentIDs

func (_u *PaymentCustomerUpdate) RemovePaymentIntentIDs(ids ...int) *PaymentCustomerUpdate

RemovePaymentIntentIDs removes the "payment_intents" edge to PaymentIntent entities by IDs.

func (*PaymentCustomerUpdate) RemovePaymentIntents

func (_u *PaymentCustomerUpdate) RemovePaymentIntents(v ...*PaymentIntent) *PaymentCustomerUpdate

RemovePaymentIntents removes "payment_intents" edges to PaymentIntent entities.

func (*PaymentCustomerUpdate) RemovePaymentMethodIDs

func (_u *PaymentCustomerUpdate) RemovePaymentMethodIDs(ids ...int) *PaymentCustomerUpdate

RemovePaymentMethodIDs removes the "payment_methods" edge to PaymentMethod entities by IDs.

func (*PaymentCustomerUpdate) RemovePaymentMethods

func (_u *PaymentCustomerUpdate) RemovePaymentMethods(v ...*PaymentMethod) *PaymentCustomerUpdate

RemovePaymentMethods removes "payment_methods" edges to PaymentMethod entities.

func (*PaymentCustomerUpdate) RemoveSubscriptionIDs

func (_u *PaymentCustomerUpdate) RemoveSubscriptionIDs(ids ...int) *PaymentCustomerUpdate

RemoveSubscriptionIDs removes the "subscriptions" edge to Subscription entities by IDs.

func (*PaymentCustomerUpdate) RemoveSubscriptions

func (_u *PaymentCustomerUpdate) RemoveSubscriptions(v ...*Subscription) *PaymentCustomerUpdate

RemoveSubscriptions removes "subscriptions" edges to Subscription entities.

func (*PaymentCustomerUpdate) Save

func (_u *PaymentCustomerUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PaymentCustomerUpdate) SaveX

func (_u *PaymentCustomerUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PaymentCustomerUpdate) SetEmail

SetEmail sets the "email" field.

func (*PaymentCustomerUpdate) SetMetadata

func (_u *PaymentCustomerUpdate) SetMetadata(v map[string]interface{}) *PaymentCustomerUpdate

SetMetadata sets the "metadata" field.

func (*PaymentCustomerUpdate) SetName

SetName sets the "name" field.

func (*PaymentCustomerUpdate) SetNillableEmail

func (_u *PaymentCustomerUpdate) SetNillableEmail(v *string) *PaymentCustomerUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*PaymentCustomerUpdate) SetNillableName

func (_u *PaymentCustomerUpdate) SetNillableName(v *string) *PaymentCustomerUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*PaymentCustomerUpdate) SetNillableProvider

func (_u *PaymentCustomerUpdate) SetNillableProvider(v *string) *PaymentCustomerUpdate

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*PaymentCustomerUpdate) SetNillableProviderCustomerID

func (_u *PaymentCustomerUpdate) SetNillableProviderCustomerID(v *string) *PaymentCustomerUpdate

SetNillableProviderCustomerID sets the "provider_customer_id" field if the given value is not nil.

func (*PaymentCustomerUpdate) SetProvider

SetProvider sets the "provider" field.

func (*PaymentCustomerUpdate) SetProviderCustomerID

func (_u *PaymentCustomerUpdate) SetProviderCustomerID(v string) *PaymentCustomerUpdate

SetProviderCustomerID sets the "provider_customer_id" field.

func (*PaymentCustomerUpdate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*PaymentCustomerUpdate) SetUser

SetUser sets the "user" edge to the User entity.

func (*PaymentCustomerUpdate) SetUserID

func (_u *PaymentCustomerUpdate) SetUserID(id int) *PaymentCustomerUpdate

SetUserID sets the "user" edge to the User entity by ID.

func (*PaymentCustomerUpdate) Where

Where appends a list predicates to the PaymentCustomerUpdate builder.

type PaymentCustomerUpdateOne

type PaymentCustomerUpdateOne struct {
	// contains filtered or unexported fields
}

PaymentCustomerUpdateOne is the builder for updating a single PaymentCustomer entity.

func (*PaymentCustomerUpdateOne) AddPaymentIntentIDs

func (_u *PaymentCustomerUpdateOne) AddPaymentIntentIDs(ids ...int) *PaymentCustomerUpdateOne

AddPaymentIntentIDs adds the "payment_intents" edge to the PaymentIntent entity by IDs.

func (*PaymentCustomerUpdateOne) AddPaymentIntents

func (_u *PaymentCustomerUpdateOne) AddPaymentIntents(v ...*PaymentIntent) *PaymentCustomerUpdateOne

AddPaymentIntents adds the "payment_intents" edges to the PaymentIntent entity.

func (*PaymentCustomerUpdateOne) AddPaymentMethodIDs

func (_u *PaymentCustomerUpdateOne) AddPaymentMethodIDs(ids ...int) *PaymentCustomerUpdateOne

AddPaymentMethodIDs adds the "payment_methods" edge to the PaymentMethod entity by IDs.

func (*PaymentCustomerUpdateOne) AddPaymentMethods

func (_u *PaymentCustomerUpdateOne) AddPaymentMethods(v ...*PaymentMethod) *PaymentCustomerUpdateOne

AddPaymentMethods adds the "payment_methods" edges to the PaymentMethod entity.

func (*PaymentCustomerUpdateOne) AddSubscriptionIDs

func (_u *PaymentCustomerUpdateOne) AddSubscriptionIDs(ids ...int) *PaymentCustomerUpdateOne

AddSubscriptionIDs adds the "subscriptions" edge to the Subscription entity by IDs.

func (*PaymentCustomerUpdateOne) AddSubscriptions

func (_u *PaymentCustomerUpdateOne) AddSubscriptions(v ...*Subscription) *PaymentCustomerUpdateOne

AddSubscriptions adds the "subscriptions" edges to the Subscription entity.

func (*PaymentCustomerUpdateOne) ClearMetadata

ClearMetadata clears the value of the "metadata" field.

func (*PaymentCustomerUpdateOne) ClearName

ClearName clears the value of the "name" field.

func (*PaymentCustomerUpdateOne) ClearPaymentIntents

func (_u *PaymentCustomerUpdateOne) ClearPaymentIntents() *PaymentCustomerUpdateOne

ClearPaymentIntents clears all "payment_intents" edges to the PaymentIntent entity.

func (*PaymentCustomerUpdateOne) ClearPaymentMethods

func (_u *PaymentCustomerUpdateOne) ClearPaymentMethods() *PaymentCustomerUpdateOne

ClearPaymentMethods clears all "payment_methods" edges to the PaymentMethod entity.

func (*PaymentCustomerUpdateOne) ClearSubscriptions

func (_u *PaymentCustomerUpdateOne) ClearSubscriptions() *PaymentCustomerUpdateOne

ClearSubscriptions clears all "subscriptions" edges to the Subscription entity.

func (*PaymentCustomerUpdateOne) ClearUser

ClearUser clears the "user" edge to the User entity.

func (*PaymentCustomerUpdateOne) Exec

Exec executes the query on the entity.

func (*PaymentCustomerUpdateOne) ExecX

func (_u *PaymentCustomerUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PaymentCustomerUpdateOne) Mutation

Mutation returns the PaymentCustomerMutation object of the builder.

func (*PaymentCustomerUpdateOne) RemovePaymentIntentIDs

func (_u *PaymentCustomerUpdateOne) RemovePaymentIntentIDs(ids ...int) *PaymentCustomerUpdateOne

RemovePaymentIntentIDs removes the "payment_intents" edge to PaymentIntent entities by IDs.

func (*PaymentCustomerUpdateOne) RemovePaymentIntents

func (_u *PaymentCustomerUpdateOne) RemovePaymentIntents(v ...*PaymentIntent) *PaymentCustomerUpdateOne

RemovePaymentIntents removes "payment_intents" edges to PaymentIntent entities.

func (*PaymentCustomerUpdateOne) RemovePaymentMethodIDs

func (_u *PaymentCustomerUpdateOne) RemovePaymentMethodIDs(ids ...int) *PaymentCustomerUpdateOne

RemovePaymentMethodIDs removes the "payment_methods" edge to PaymentMethod entities by IDs.

func (*PaymentCustomerUpdateOne) RemovePaymentMethods

func (_u *PaymentCustomerUpdateOne) RemovePaymentMethods(v ...*PaymentMethod) *PaymentCustomerUpdateOne

RemovePaymentMethods removes "payment_methods" edges to PaymentMethod entities.

func (*PaymentCustomerUpdateOne) RemoveSubscriptionIDs

func (_u *PaymentCustomerUpdateOne) RemoveSubscriptionIDs(ids ...int) *PaymentCustomerUpdateOne

RemoveSubscriptionIDs removes the "subscriptions" edge to Subscription entities by IDs.

func (*PaymentCustomerUpdateOne) RemoveSubscriptions

func (_u *PaymentCustomerUpdateOne) RemoveSubscriptions(v ...*Subscription) *PaymentCustomerUpdateOne

RemoveSubscriptions removes "subscriptions" edges to Subscription entities.

func (*PaymentCustomerUpdateOne) Save

Save executes the query and returns the updated PaymentCustomer entity.

func (*PaymentCustomerUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*PaymentCustomerUpdateOne) Select

func (_u *PaymentCustomerUpdateOne) Select(field string, fields ...string) *PaymentCustomerUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PaymentCustomerUpdateOne) SetEmail

SetEmail sets the "email" field.

func (*PaymentCustomerUpdateOne) SetMetadata

func (_u *PaymentCustomerUpdateOne) SetMetadata(v map[string]interface{}) *PaymentCustomerUpdateOne

SetMetadata sets the "metadata" field.

func (*PaymentCustomerUpdateOne) SetName

SetName sets the "name" field.

func (*PaymentCustomerUpdateOne) SetNillableEmail

func (_u *PaymentCustomerUpdateOne) SetNillableEmail(v *string) *PaymentCustomerUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*PaymentCustomerUpdateOne) SetNillableName

func (_u *PaymentCustomerUpdateOne) SetNillableName(v *string) *PaymentCustomerUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*PaymentCustomerUpdateOne) SetNillableProvider

func (_u *PaymentCustomerUpdateOne) SetNillableProvider(v *string) *PaymentCustomerUpdateOne

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*PaymentCustomerUpdateOne) SetNillableProviderCustomerID

func (_u *PaymentCustomerUpdateOne) SetNillableProviderCustomerID(v *string) *PaymentCustomerUpdateOne

SetNillableProviderCustomerID sets the "provider_customer_id" field if the given value is not nil.

func (*PaymentCustomerUpdateOne) SetProvider

SetProvider sets the "provider" field.

func (*PaymentCustomerUpdateOne) SetProviderCustomerID

func (_u *PaymentCustomerUpdateOne) SetProviderCustomerID(v string) *PaymentCustomerUpdateOne

SetProviderCustomerID sets the "provider_customer_id" field.

func (*PaymentCustomerUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*PaymentCustomerUpdateOne) SetUser

SetUser sets the "user" edge to the User entity.

func (*PaymentCustomerUpdateOne) SetUserID

SetUserID sets the "user" edge to the User entity by ID.

func (*PaymentCustomerUpdateOne) Where

Where appends a list predicates to the PaymentCustomerUpdate builder.

type PaymentCustomers

type PaymentCustomers []*PaymentCustomer

PaymentCustomers is a parsable slice of PaymentCustomer.

type PaymentIntent

type PaymentIntent struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// External payment provider payment intent ID
	ProviderPaymentIntentID string `json:"provider_payment_intent_id,omitempty"`
	// Payment provider name
	Provider string `json:"provider,omitempty"`
	// Payment intent status from provider
	Status paymentintent.Status `json:"status,omitempty"`
	// Amount in smallest currency unit (e.g., cents)
	Amount int64 `json:"amount,omitempty"`
	// Three-letter ISO currency code
	Currency string `json:"currency,omitempty"`
	// Description of the payment
	Description string `json:"description,omitempty"`
	// Client secret for frontend payment processing
	ClientSecret string `json:"-"`
	// Additional payment data
	Metadata map[string]interface{} `json:"metadata,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PaymentIntentQuery when eager-loading is set.
	Edges PaymentIntentEdges `json:"edges"`
	// contains filtered or unexported fields
}

PaymentIntent is the model entity for the PaymentIntent schema.

func (*PaymentIntent) QueryCustomer

func (_m *PaymentIntent) QueryCustomer() *PaymentCustomerQuery

QueryCustomer queries the "customer" edge of the PaymentIntent entity.

func (*PaymentIntent) String

func (_m *PaymentIntent) String() string

String implements the fmt.Stringer.

func (*PaymentIntent) Unwrap

func (_m *PaymentIntent) Unwrap() *PaymentIntent

Unwrap unwraps the PaymentIntent entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*PaymentIntent) Update

func (_m *PaymentIntent) Update() *PaymentIntentUpdateOne

Update returns a builder for updating this PaymentIntent. Note that you need to call PaymentIntent.Unwrap() before calling this method if this PaymentIntent was returned from a transaction, and the transaction was committed or rolled back.

func (*PaymentIntent) Value

func (_m *PaymentIntent) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the PaymentIntent. This includes values selected through modifiers, order, etc.

type PaymentIntentClient

type PaymentIntentClient struct {
	// contains filtered or unexported fields
}

PaymentIntentClient is a client for the PaymentIntent schema.

func NewPaymentIntentClient

func NewPaymentIntentClient(c config) *PaymentIntentClient

NewPaymentIntentClient returns a client for the PaymentIntent from the given config.

func (*PaymentIntentClient) Create

Create returns a builder for creating a PaymentIntent entity.

func (*PaymentIntentClient) CreateBulk

CreateBulk returns a builder for creating a bulk of PaymentIntent entities.

func (*PaymentIntentClient) Delete

Delete returns a delete builder for PaymentIntent.

func (*PaymentIntentClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PaymentIntentClient) DeleteOneID

func (c *PaymentIntentClient) DeleteOneID(id int) *PaymentIntentDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PaymentIntentClient) Get

Get returns a PaymentIntent entity by its id.

func (*PaymentIntentClient) GetX

GetX is like Get, but panics if an error occurs.

func (*PaymentIntentClient) Hooks

func (c *PaymentIntentClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PaymentIntentClient) Intercept

func (c *PaymentIntentClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `paymentintent.Intercept(f(g(h())))`.

func (*PaymentIntentClient) Interceptors

func (c *PaymentIntentClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PaymentIntentClient) MapCreateBulk

func (c *PaymentIntentClient) MapCreateBulk(slice any, setFunc func(*PaymentIntentCreate, int)) *PaymentIntentCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*PaymentIntentClient) Query

Query returns a query builder for PaymentIntent.

func (*PaymentIntentClient) QueryCustomer

QueryCustomer queries the customer edge of a PaymentIntent.

func (*PaymentIntentClient) Update

Update returns an update builder for PaymentIntent.

func (*PaymentIntentClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*PaymentIntentClient) UpdateOneID

func (c *PaymentIntentClient) UpdateOneID(id int) *PaymentIntentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PaymentIntentClient) Use

func (c *PaymentIntentClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `paymentintent.Hooks(f(g(h())))`.

type PaymentIntentCreate

type PaymentIntentCreate struct {
	// contains filtered or unexported fields
}

PaymentIntentCreate is the builder for creating a PaymentIntent entity.

func (*PaymentIntentCreate) Exec

func (_c *PaymentIntentCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PaymentIntentCreate) ExecX

func (_c *PaymentIntentCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PaymentIntentCreate) Mutation

Mutation returns the PaymentIntentMutation object of the builder.

func (*PaymentIntentCreate) Save

Save creates the PaymentIntent in the database.

func (*PaymentIntentCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*PaymentIntentCreate) SetAmount

func (_c *PaymentIntentCreate) SetAmount(v int64) *PaymentIntentCreate

SetAmount sets the "amount" field.

func (*PaymentIntentCreate) SetClientSecret

func (_c *PaymentIntentCreate) SetClientSecret(v string) *PaymentIntentCreate

SetClientSecret sets the "client_secret" field.

func (*PaymentIntentCreate) SetCreatedAt

func (_c *PaymentIntentCreate) SetCreatedAt(v time.Time) *PaymentIntentCreate

SetCreatedAt sets the "created_at" field.

func (*PaymentIntentCreate) SetCurrency

func (_c *PaymentIntentCreate) SetCurrency(v string) *PaymentIntentCreate

SetCurrency sets the "currency" field.

func (*PaymentIntentCreate) SetCustomer

SetCustomer sets the "customer" edge to the PaymentCustomer entity.

func (*PaymentIntentCreate) SetCustomerID

func (_c *PaymentIntentCreate) SetCustomerID(id int) *PaymentIntentCreate

SetCustomerID sets the "customer" edge to the PaymentCustomer entity by ID.

func (*PaymentIntentCreate) SetDescription

func (_c *PaymentIntentCreate) SetDescription(v string) *PaymentIntentCreate

SetDescription sets the "description" field.

func (*PaymentIntentCreate) SetMetadata

func (_c *PaymentIntentCreate) SetMetadata(v map[string]interface{}) *PaymentIntentCreate

SetMetadata sets the "metadata" field.

func (*PaymentIntentCreate) SetNillableClientSecret

func (_c *PaymentIntentCreate) SetNillableClientSecret(v *string) *PaymentIntentCreate

SetNillableClientSecret sets the "client_secret" field if the given value is not nil.

func (*PaymentIntentCreate) SetNillableCreatedAt

func (_c *PaymentIntentCreate) SetNillableCreatedAt(v *time.Time) *PaymentIntentCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PaymentIntentCreate) SetNillableCurrency

func (_c *PaymentIntentCreate) SetNillableCurrency(v *string) *PaymentIntentCreate

SetNillableCurrency sets the "currency" field if the given value is not nil.

func (*PaymentIntentCreate) SetNillableDescription

func (_c *PaymentIntentCreate) SetNillableDescription(v *string) *PaymentIntentCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*PaymentIntentCreate) SetNillableProvider

func (_c *PaymentIntentCreate) SetNillableProvider(v *string) *PaymentIntentCreate

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*PaymentIntentCreate) SetNillableStatus

func (_c *PaymentIntentCreate) SetNillableStatus(v *paymentintent.Status) *PaymentIntentCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*PaymentIntentCreate) SetNillableUpdatedAt

func (_c *PaymentIntentCreate) SetNillableUpdatedAt(v *time.Time) *PaymentIntentCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*PaymentIntentCreate) SetProvider

func (_c *PaymentIntentCreate) SetProvider(v string) *PaymentIntentCreate

SetProvider sets the "provider" field.

func (*PaymentIntentCreate) SetProviderPaymentIntentID

func (_c *PaymentIntentCreate) SetProviderPaymentIntentID(v string) *PaymentIntentCreate

SetProviderPaymentIntentID sets the "provider_payment_intent_id" field.

func (*PaymentIntentCreate) SetStatus

SetStatus sets the "status" field.

func (*PaymentIntentCreate) SetUpdatedAt

func (_c *PaymentIntentCreate) SetUpdatedAt(v time.Time) *PaymentIntentCreate

SetUpdatedAt sets the "updated_at" field.

type PaymentIntentCreateBulk

type PaymentIntentCreateBulk struct {
	// contains filtered or unexported fields
}

PaymentIntentCreateBulk is the builder for creating many PaymentIntent entities in bulk.

func (*PaymentIntentCreateBulk) Exec

Exec executes the query.

func (*PaymentIntentCreateBulk) ExecX

func (_c *PaymentIntentCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PaymentIntentCreateBulk) Save

Save creates the PaymentIntent entities in the database.

func (*PaymentIntentCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type PaymentIntentDelete

type PaymentIntentDelete struct {
	// contains filtered or unexported fields
}

PaymentIntentDelete is the builder for deleting a PaymentIntent entity.

func (*PaymentIntentDelete) Exec

func (_d *PaymentIntentDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PaymentIntentDelete) ExecX

func (_d *PaymentIntentDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PaymentIntentDelete) Where

Where appends a list predicates to the PaymentIntentDelete builder.

type PaymentIntentDeleteOne

type PaymentIntentDeleteOne struct {
	// contains filtered or unexported fields
}

PaymentIntentDeleteOne is the builder for deleting a single PaymentIntent entity.

func (*PaymentIntentDeleteOne) Exec

Exec executes the deletion query.

func (*PaymentIntentDeleteOne) ExecX

func (_d *PaymentIntentDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PaymentIntentDeleteOne) Where

Where appends a list predicates to the PaymentIntentDelete builder.

type PaymentIntentEdges

type PaymentIntentEdges struct {
	// Payment customer who owns this payment intent
	Customer *PaymentCustomer `json:"customer,omitempty"`
	// contains filtered or unexported fields
}

PaymentIntentEdges holds the relations/edges for other nodes in the graph.

func (PaymentIntentEdges) CustomerOrErr

func (e PaymentIntentEdges) CustomerOrErr() (*PaymentCustomer, error)

CustomerOrErr returns the Customer value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type PaymentIntentGroupBy

type PaymentIntentGroupBy struct {
	// contains filtered or unexported fields
}

PaymentIntentGroupBy is the group-by builder for PaymentIntent entities.

func (*PaymentIntentGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*PaymentIntentGroupBy) Bool

func (s *PaymentIntentGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PaymentIntentGroupBy) BoolX

func (s *PaymentIntentGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PaymentIntentGroupBy) Bools

func (s *PaymentIntentGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PaymentIntentGroupBy) BoolsX

func (s *PaymentIntentGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PaymentIntentGroupBy) Float64

func (s *PaymentIntentGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PaymentIntentGroupBy) Float64X

func (s *PaymentIntentGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PaymentIntentGroupBy) Float64s

func (s *PaymentIntentGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PaymentIntentGroupBy) Float64sX

func (s *PaymentIntentGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PaymentIntentGroupBy) Int

func (s *PaymentIntentGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PaymentIntentGroupBy) IntX

func (s *PaymentIntentGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PaymentIntentGroupBy) Ints

func (s *PaymentIntentGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PaymentIntentGroupBy) IntsX

func (s *PaymentIntentGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PaymentIntentGroupBy) Scan

func (_g *PaymentIntentGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PaymentIntentGroupBy) ScanX

func (s *PaymentIntentGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PaymentIntentGroupBy) String

func (s *PaymentIntentGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PaymentIntentGroupBy) StringX

func (s *PaymentIntentGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PaymentIntentGroupBy) Strings

func (s *PaymentIntentGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PaymentIntentGroupBy) StringsX

func (s *PaymentIntentGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PaymentIntentMutation

type PaymentIntentMutation struct {
	// contains filtered or unexported fields
}

PaymentIntentMutation represents an operation that mutates the PaymentIntent nodes in the graph.

func (*PaymentIntentMutation) AddAmount

func (m *PaymentIntentMutation) AddAmount(i int64)

AddAmount adds i to the "amount" field.

func (*PaymentIntentMutation) AddField

func (m *PaymentIntentMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*PaymentIntentMutation) AddedAmount

func (m *PaymentIntentMutation) AddedAmount() (r int64, exists bool)

AddedAmount returns the value that was added to the "amount" field in this mutation.

func (*PaymentIntentMutation) AddedEdges

func (m *PaymentIntentMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PaymentIntentMutation) AddedField

func (m *PaymentIntentMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*PaymentIntentMutation) AddedFields

func (m *PaymentIntentMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PaymentIntentMutation) AddedIDs

func (m *PaymentIntentMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PaymentIntentMutation) Amount

func (m *PaymentIntentMutation) Amount() (r int64, exists bool)

Amount returns the value of the "amount" field in the mutation.

func (*PaymentIntentMutation) ClearClientSecret

func (m *PaymentIntentMutation) ClearClientSecret()

ClearClientSecret clears the value of the "client_secret" field.

func (*PaymentIntentMutation) ClearCustomer

func (m *PaymentIntentMutation) ClearCustomer()

ClearCustomer clears the "customer" edge to the PaymentCustomer entity.

func (*PaymentIntentMutation) ClearDescription

func (m *PaymentIntentMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*PaymentIntentMutation) ClearEdge

func (m *PaymentIntentMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*PaymentIntentMutation) ClearField

func (m *PaymentIntentMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*PaymentIntentMutation) ClearMetadata

func (m *PaymentIntentMutation) ClearMetadata()

ClearMetadata clears the value of the "metadata" field.

func (*PaymentIntentMutation) ClearedEdges

func (m *PaymentIntentMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PaymentIntentMutation) ClearedFields

func (m *PaymentIntentMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PaymentIntentMutation) Client

func (m PaymentIntentMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*PaymentIntentMutation) ClientSecret

func (m *PaymentIntentMutation) ClientSecret() (r string, exists bool)

ClientSecret returns the value of the "client_secret" field in the mutation.

func (*PaymentIntentMutation) ClientSecretCleared

func (m *PaymentIntentMutation) ClientSecretCleared() bool

ClientSecretCleared returns if the "client_secret" field was cleared in this mutation.

func (*PaymentIntentMutation) CreatedAt

func (m *PaymentIntentMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*PaymentIntentMutation) Currency

func (m *PaymentIntentMutation) Currency() (r string, exists bool)

Currency returns the value of the "currency" field in the mutation.

func (*PaymentIntentMutation) CustomerCleared

func (m *PaymentIntentMutation) CustomerCleared() bool

CustomerCleared reports if the "customer" edge to the PaymentCustomer entity was cleared.

func (*PaymentIntentMutation) CustomerID

func (m *PaymentIntentMutation) CustomerID() (id int, exists bool)

CustomerID returns the "customer" edge ID in the mutation.

func (*PaymentIntentMutation) CustomerIDs

func (m *PaymentIntentMutation) CustomerIDs() (ids []int)

CustomerIDs returns the "customer" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CustomerID instead. It exists only for internal usage by the builders.

func (*PaymentIntentMutation) Description

func (m *PaymentIntentMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*PaymentIntentMutation) DescriptionCleared

func (m *PaymentIntentMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*PaymentIntentMutation) EdgeCleared

func (m *PaymentIntentMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PaymentIntentMutation) Field

func (m *PaymentIntentMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*PaymentIntentMutation) FieldCleared

func (m *PaymentIntentMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PaymentIntentMutation) Fields

func (m *PaymentIntentMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*PaymentIntentMutation) ID

func (m *PaymentIntentMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*PaymentIntentMutation) IDs

func (m *PaymentIntentMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*PaymentIntentMutation) Metadata

func (m *PaymentIntentMutation) Metadata() (r map[string]interface{}, exists bool)

Metadata returns the value of the "metadata" field in the mutation.

func (*PaymentIntentMutation) MetadataCleared

func (m *PaymentIntentMutation) MetadataCleared() bool

MetadataCleared returns if the "metadata" field was cleared in this mutation.

func (*PaymentIntentMutation) OldAmount

func (m *PaymentIntentMutation) OldAmount(ctx context.Context) (v int64, err error)

OldAmount returns the old "amount" field's value of the PaymentIntent entity. If the PaymentIntent object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentIntentMutation) OldClientSecret

func (m *PaymentIntentMutation) OldClientSecret(ctx context.Context) (v string, err error)

OldClientSecret returns the old "client_secret" field's value of the PaymentIntent entity. If the PaymentIntent object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentIntentMutation) OldCreatedAt

func (m *PaymentIntentMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the PaymentIntent entity. If the PaymentIntent object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentIntentMutation) OldCurrency

func (m *PaymentIntentMutation) OldCurrency(ctx context.Context) (v string, err error)

OldCurrency returns the old "currency" field's value of the PaymentIntent entity. If the PaymentIntent object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentIntentMutation) OldDescription

func (m *PaymentIntentMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the PaymentIntent entity. If the PaymentIntent object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentIntentMutation) OldField

func (m *PaymentIntentMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*PaymentIntentMutation) OldMetadata

func (m *PaymentIntentMutation) OldMetadata(ctx context.Context) (v map[string]interface{}, err error)

OldMetadata returns the old "metadata" field's value of the PaymentIntent entity. If the PaymentIntent object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentIntentMutation) OldProvider

func (m *PaymentIntentMutation) OldProvider(ctx context.Context) (v string, err error)

OldProvider returns the old "provider" field's value of the PaymentIntent entity. If the PaymentIntent object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentIntentMutation) OldProviderPaymentIntentID

func (m *PaymentIntentMutation) OldProviderPaymentIntentID(ctx context.Context) (v string, err error)

OldProviderPaymentIntentID returns the old "provider_payment_intent_id" field's value of the PaymentIntent entity. If the PaymentIntent object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentIntentMutation) OldStatus

func (m *PaymentIntentMutation) OldStatus(ctx context.Context) (v paymentintent.Status, err error)

OldStatus returns the old "status" field's value of the PaymentIntent entity. If the PaymentIntent object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentIntentMutation) OldUpdatedAt

func (m *PaymentIntentMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the PaymentIntent entity. If the PaymentIntent object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentIntentMutation) Op

func (m *PaymentIntentMutation) Op() Op

Op returns the operation name.

func (*PaymentIntentMutation) Provider

func (m *PaymentIntentMutation) Provider() (r string, exists bool)

Provider returns the value of the "provider" field in the mutation.

func (*PaymentIntentMutation) ProviderPaymentIntentID

func (m *PaymentIntentMutation) ProviderPaymentIntentID() (r string, exists bool)

ProviderPaymentIntentID returns the value of the "provider_payment_intent_id" field in the mutation.

func (*PaymentIntentMutation) RemovedEdges

func (m *PaymentIntentMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PaymentIntentMutation) RemovedIDs

func (m *PaymentIntentMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*PaymentIntentMutation) ResetAmount

func (m *PaymentIntentMutation) ResetAmount()

ResetAmount resets all changes to the "amount" field.

func (*PaymentIntentMutation) ResetClientSecret

func (m *PaymentIntentMutation) ResetClientSecret()

ResetClientSecret resets all changes to the "client_secret" field.

func (*PaymentIntentMutation) ResetCreatedAt

func (m *PaymentIntentMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PaymentIntentMutation) ResetCurrency

func (m *PaymentIntentMutation) ResetCurrency()

ResetCurrency resets all changes to the "currency" field.

func (*PaymentIntentMutation) ResetCustomer

func (m *PaymentIntentMutation) ResetCustomer()

ResetCustomer resets all changes to the "customer" edge.

func (*PaymentIntentMutation) ResetDescription

func (m *PaymentIntentMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*PaymentIntentMutation) ResetEdge

func (m *PaymentIntentMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*PaymentIntentMutation) ResetField

func (m *PaymentIntentMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*PaymentIntentMutation) ResetMetadata

func (m *PaymentIntentMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" field.

func (*PaymentIntentMutation) ResetProvider

func (m *PaymentIntentMutation) ResetProvider()

ResetProvider resets all changes to the "provider" field.

func (*PaymentIntentMutation) ResetProviderPaymentIntentID

func (m *PaymentIntentMutation) ResetProviderPaymentIntentID()

ResetProviderPaymentIntentID resets all changes to the "provider_payment_intent_id" field.

func (*PaymentIntentMutation) ResetStatus

func (m *PaymentIntentMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*PaymentIntentMutation) ResetUpdatedAt

func (m *PaymentIntentMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*PaymentIntentMutation) SetAmount

func (m *PaymentIntentMutation) SetAmount(i int64)

SetAmount sets the "amount" field.

func (*PaymentIntentMutation) SetClientSecret

func (m *PaymentIntentMutation) SetClientSecret(s string)

SetClientSecret sets the "client_secret" field.

func (*PaymentIntentMutation) SetCreatedAt

func (m *PaymentIntentMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*PaymentIntentMutation) SetCurrency

func (m *PaymentIntentMutation) SetCurrency(s string)

SetCurrency sets the "currency" field.

func (*PaymentIntentMutation) SetCustomerID

func (m *PaymentIntentMutation) SetCustomerID(id int)

SetCustomerID sets the "customer" edge to the PaymentCustomer entity by id.

func (*PaymentIntentMutation) SetDescription

func (m *PaymentIntentMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*PaymentIntentMutation) SetField

func (m *PaymentIntentMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*PaymentIntentMutation) SetMetadata

func (m *PaymentIntentMutation) SetMetadata(value map[string]interface{})

SetMetadata sets the "metadata" field.

func (*PaymentIntentMutation) SetOp

func (m *PaymentIntentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PaymentIntentMutation) SetProvider

func (m *PaymentIntentMutation) SetProvider(s string)

SetProvider sets the "provider" field.

func (*PaymentIntentMutation) SetProviderPaymentIntentID

func (m *PaymentIntentMutation) SetProviderPaymentIntentID(s string)

SetProviderPaymentIntentID sets the "provider_payment_intent_id" field.

func (*PaymentIntentMutation) SetStatus

func (m *PaymentIntentMutation) SetStatus(pa paymentintent.Status)

SetStatus sets the "status" field.

func (*PaymentIntentMutation) SetUpdatedAt

func (m *PaymentIntentMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*PaymentIntentMutation) Status

func (m *PaymentIntentMutation) Status() (r paymentintent.Status, exists bool)

Status returns the value of the "status" field in the mutation.

func (PaymentIntentMutation) Tx

func (m PaymentIntentMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PaymentIntentMutation) Type

func (m *PaymentIntentMutation) Type() string

Type returns the node type of this mutation (PaymentIntent).

func (*PaymentIntentMutation) UpdatedAt

func (m *PaymentIntentMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*PaymentIntentMutation) Where

Where appends a list predicates to the PaymentIntentMutation builder.

func (*PaymentIntentMutation) WhereP

func (m *PaymentIntentMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PaymentIntentMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PaymentIntentQuery

type PaymentIntentQuery struct {
	// contains filtered or unexported fields
}

PaymentIntentQuery is the builder for querying PaymentIntent entities.

func (*PaymentIntentQuery) Aggregate

func (_q *PaymentIntentQuery) Aggregate(fns ...AggregateFunc) *PaymentIntentSelect

Aggregate returns a PaymentIntentSelect configured with the given aggregations.

func (*PaymentIntentQuery) All

All executes the query and returns a list of PaymentIntents.

func (*PaymentIntentQuery) AllX

AllX is like All, but panics if an error occurs.

func (*PaymentIntentQuery) Clone

Clone returns a duplicate of the PaymentIntentQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PaymentIntentQuery) Count

func (_q *PaymentIntentQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PaymentIntentQuery) CountX

func (_q *PaymentIntentQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PaymentIntentQuery) Exist

func (_q *PaymentIntentQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PaymentIntentQuery) ExistX

func (_q *PaymentIntentQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PaymentIntentQuery) First

First returns the first PaymentIntent entity from the query. Returns a *NotFoundError when no PaymentIntent was found.

func (*PaymentIntentQuery) FirstID

func (_q *PaymentIntentQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first PaymentIntent ID from the query. Returns a *NotFoundError when no PaymentIntent ID was found.

func (*PaymentIntentQuery) FirstIDX

func (_q *PaymentIntentQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*PaymentIntentQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*PaymentIntentQuery) GroupBy

func (_q *PaymentIntentQuery) GroupBy(field string, fields ...string) *PaymentIntentGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	ProviderPaymentIntentID string `json:"provider_payment_intent_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.PaymentIntent.Query().
	GroupBy(paymentintent.FieldProviderPaymentIntentID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PaymentIntentQuery) IDs

func (_q *PaymentIntentQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of PaymentIntent IDs.

func (*PaymentIntentQuery) IDsX

func (_q *PaymentIntentQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*PaymentIntentQuery) Limit

func (_q *PaymentIntentQuery) Limit(limit int) *PaymentIntentQuery

Limit the number of records to be returned by this query.

func (*PaymentIntentQuery) Offset

func (_q *PaymentIntentQuery) Offset(offset int) *PaymentIntentQuery

Offset to start from.

func (*PaymentIntentQuery) Only

Only returns a single PaymentIntent entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one PaymentIntent entity is found. Returns a *NotFoundError when no PaymentIntent entities are found.

func (*PaymentIntentQuery) OnlyID

func (_q *PaymentIntentQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only PaymentIntent ID in the query. Returns a *NotSingularError when more than one PaymentIntent ID is found. Returns a *NotFoundError when no entities are found.

func (*PaymentIntentQuery) OnlyIDX

func (_q *PaymentIntentQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PaymentIntentQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*PaymentIntentQuery) Order

Order specifies how the records should be ordered.

func (*PaymentIntentQuery) QueryCustomer

func (_q *PaymentIntentQuery) QueryCustomer() *PaymentCustomerQuery

QueryCustomer chains the current query on the "customer" edge.

func (*PaymentIntentQuery) Select

func (_q *PaymentIntentQuery) Select(fields ...string) *PaymentIntentSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	ProviderPaymentIntentID string `json:"provider_payment_intent_id,omitempty"`
}

client.PaymentIntent.Query().
	Select(paymentintent.FieldProviderPaymentIntentID).
	Scan(ctx, &v)

func (*PaymentIntentQuery) Unique

func (_q *PaymentIntentQuery) Unique(unique bool) *PaymentIntentQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*PaymentIntentQuery) Where

Where adds a new predicate for the PaymentIntentQuery builder.

func (*PaymentIntentQuery) WithCustomer

func (_q *PaymentIntentQuery) WithCustomer(opts ...func(*PaymentCustomerQuery)) *PaymentIntentQuery

WithCustomer tells the query-builder to eager-load the nodes that are connected to the "customer" edge. The optional arguments are used to configure the query builder of the edge.

type PaymentIntentSelect

type PaymentIntentSelect struct {
	*PaymentIntentQuery
	// contains filtered or unexported fields
}

PaymentIntentSelect is the builder for selecting fields of PaymentIntent entities.

func (*PaymentIntentSelect) Aggregate

func (_s *PaymentIntentSelect) Aggregate(fns ...AggregateFunc) *PaymentIntentSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PaymentIntentSelect) Bool

func (s *PaymentIntentSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PaymentIntentSelect) BoolX

func (s *PaymentIntentSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PaymentIntentSelect) Bools

func (s *PaymentIntentSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PaymentIntentSelect) BoolsX

func (s *PaymentIntentSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PaymentIntentSelect) Float64

func (s *PaymentIntentSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PaymentIntentSelect) Float64X

func (s *PaymentIntentSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PaymentIntentSelect) Float64s

func (s *PaymentIntentSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PaymentIntentSelect) Float64sX

func (s *PaymentIntentSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PaymentIntentSelect) Int

func (s *PaymentIntentSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PaymentIntentSelect) IntX

func (s *PaymentIntentSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PaymentIntentSelect) Ints

func (s *PaymentIntentSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PaymentIntentSelect) IntsX

func (s *PaymentIntentSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PaymentIntentSelect) Scan

func (_s *PaymentIntentSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PaymentIntentSelect) ScanX

func (s *PaymentIntentSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PaymentIntentSelect) String

func (s *PaymentIntentSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PaymentIntentSelect) StringX

func (s *PaymentIntentSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PaymentIntentSelect) Strings

func (s *PaymentIntentSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PaymentIntentSelect) StringsX

func (s *PaymentIntentSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PaymentIntentUpdate

type PaymentIntentUpdate struct {
	// contains filtered or unexported fields
}

PaymentIntentUpdate is the builder for updating PaymentIntent entities.

func (*PaymentIntentUpdate) AddAmount

func (_u *PaymentIntentUpdate) AddAmount(v int64) *PaymentIntentUpdate

AddAmount adds value to the "amount" field.

func (*PaymentIntentUpdate) ClearClientSecret

func (_u *PaymentIntentUpdate) ClearClientSecret() *PaymentIntentUpdate

ClearClientSecret clears the value of the "client_secret" field.

func (*PaymentIntentUpdate) ClearCustomer

func (_u *PaymentIntentUpdate) ClearCustomer() *PaymentIntentUpdate

ClearCustomer clears the "customer" edge to the PaymentCustomer entity.

func (*PaymentIntentUpdate) ClearDescription

func (_u *PaymentIntentUpdate) ClearDescription() *PaymentIntentUpdate

ClearDescription clears the value of the "description" field.

func (*PaymentIntentUpdate) ClearMetadata

func (_u *PaymentIntentUpdate) ClearMetadata() *PaymentIntentUpdate

ClearMetadata clears the value of the "metadata" field.

func (*PaymentIntentUpdate) Exec

func (_u *PaymentIntentUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PaymentIntentUpdate) ExecX

func (_u *PaymentIntentUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PaymentIntentUpdate) Mutation

Mutation returns the PaymentIntentMutation object of the builder.

func (*PaymentIntentUpdate) Save

func (_u *PaymentIntentUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PaymentIntentUpdate) SaveX

func (_u *PaymentIntentUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PaymentIntentUpdate) SetAmount

func (_u *PaymentIntentUpdate) SetAmount(v int64) *PaymentIntentUpdate

SetAmount sets the "amount" field.

func (*PaymentIntentUpdate) SetClientSecret

func (_u *PaymentIntentUpdate) SetClientSecret(v string) *PaymentIntentUpdate

SetClientSecret sets the "client_secret" field.

func (*PaymentIntentUpdate) SetCurrency

func (_u *PaymentIntentUpdate) SetCurrency(v string) *PaymentIntentUpdate

SetCurrency sets the "currency" field.

func (*PaymentIntentUpdate) SetCustomer

SetCustomer sets the "customer" edge to the PaymentCustomer entity.

func (*PaymentIntentUpdate) SetCustomerID

func (_u *PaymentIntentUpdate) SetCustomerID(id int) *PaymentIntentUpdate

SetCustomerID sets the "customer" edge to the PaymentCustomer entity by ID.

func (*PaymentIntentUpdate) SetDescription

func (_u *PaymentIntentUpdate) SetDescription(v string) *PaymentIntentUpdate

SetDescription sets the "description" field.

func (*PaymentIntentUpdate) SetMetadata

func (_u *PaymentIntentUpdate) SetMetadata(v map[string]interface{}) *PaymentIntentUpdate

SetMetadata sets the "metadata" field.

func (*PaymentIntentUpdate) SetNillableAmount

func (_u *PaymentIntentUpdate) SetNillableAmount(v *int64) *PaymentIntentUpdate

SetNillableAmount sets the "amount" field if the given value is not nil.

func (*PaymentIntentUpdate) SetNillableClientSecret

func (_u *PaymentIntentUpdate) SetNillableClientSecret(v *string) *PaymentIntentUpdate

SetNillableClientSecret sets the "client_secret" field if the given value is not nil.

func (*PaymentIntentUpdate) SetNillableCurrency

func (_u *PaymentIntentUpdate) SetNillableCurrency(v *string) *PaymentIntentUpdate

SetNillableCurrency sets the "currency" field if the given value is not nil.

func (*PaymentIntentUpdate) SetNillableDescription

func (_u *PaymentIntentUpdate) SetNillableDescription(v *string) *PaymentIntentUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*PaymentIntentUpdate) SetNillableProvider

func (_u *PaymentIntentUpdate) SetNillableProvider(v *string) *PaymentIntentUpdate

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*PaymentIntentUpdate) SetNillableProviderPaymentIntentID

func (_u *PaymentIntentUpdate) SetNillableProviderPaymentIntentID(v *string) *PaymentIntentUpdate

SetNillableProviderPaymentIntentID sets the "provider_payment_intent_id" field if the given value is not nil.

func (*PaymentIntentUpdate) SetNillableStatus

func (_u *PaymentIntentUpdate) SetNillableStatus(v *paymentintent.Status) *PaymentIntentUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*PaymentIntentUpdate) SetProvider

func (_u *PaymentIntentUpdate) SetProvider(v string) *PaymentIntentUpdate

SetProvider sets the "provider" field.

func (*PaymentIntentUpdate) SetProviderPaymentIntentID

func (_u *PaymentIntentUpdate) SetProviderPaymentIntentID(v string) *PaymentIntentUpdate

SetProviderPaymentIntentID sets the "provider_payment_intent_id" field.

func (*PaymentIntentUpdate) SetStatus

SetStatus sets the "status" field.

func (*PaymentIntentUpdate) SetUpdatedAt

func (_u *PaymentIntentUpdate) SetUpdatedAt(v time.Time) *PaymentIntentUpdate

SetUpdatedAt sets the "updated_at" field.

func (*PaymentIntentUpdate) Where

Where appends a list predicates to the PaymentIntentUpdate builder.

type PaymentIntentUpdateOne

type PaymentIntentUpdateOne struct {
	// contains filtered or unexported fields
}

PaymentIntentUpdateOne is the builder for updating a single PaymentIntent entity.

func (*PaymentIntentUpdateOne) AddAmount

AddAmount adds value to the "amount" field.

func (*PaymentIntentUpdateOne) ClearClientSecret

func (_u *PaymentIntentUpdateOne) ClearClientSecret() *PaymentIntentUpdateOne

ClearClientSecret clears the value of the "client_secret" field.

func (*PaymentIntentUpdateOne) ClearCustomer

func (_u *PaymentIntentUpdateOne) ClearCustomer() *PaymentIntentUpdateOne

ClearCustomer clears the "customer" edge to the PaymentCustomer entity.

func (*PaymentIntentUpdateOne) ClearDescription

func (_u *PaymentIntentUpdateOne) ClearDescription() *PaymentIntentUpdateOne

ClearDescription clears the value of the "description" field.

func (*PaymentIntentUpdateOne) ClearMetadata

func (_u *PaymentIntentUpdateOne) ClearMetadata() *PaymentIntentUpdateOne

ClearMetadata clears the value of the "metadata" field.

func (*PaymentIntentUpdateOne) Exec

Exec executes the query on the entity.

func (*PaymentIntentUpdateOne) ExecX

func (_u *PaymentIntentUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PaymentIntentUpdateOne) Mutation

Mutation returns the PaymentIntentMutation object of the builder.

func (*PaymentIntentUpdateOne) Save

Save executes the query and returns the updated PaymentIntent entity.

func (*PaymentIntentUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*PaymentIntentUpdateOne) Select

func (_u *PaymentIntentUpdateOne) Select(field string, fields ...string) *PaymentIntentUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PaymentIntentUpdateOne) SetAmount

SetAmount sets the "amount" field.

func (*PaymentIntentUpdateOne) SetClientSecret

func (_u *PaymentIntentUpdateOne) SetClientSecret(v string) *PaymentIntentUpdateOne

SetClientSecret sets the "client_secret" field.

func (*PaymentIntentUpdateOne) SetCurrency

SetCurrency sets the "currency" field.

func (*PaymentIntentUpdateOne) SetCustomer

SetCustomer sets the "customer" edge to the PaymentCustomer entity.

func (*PaymentIntentUpdateOne) SetCustomerID

func (_u *PaymentIntentUpdateOne) SetCustomerID(id int) *PaymentIntentUpdateOne

SetCustomerID sets the "customer" edge to the PaymentCustomer entity by ID.

func (*PaymentIntentUpdateOne) SetDescription

func (_u *PaymentIntentUpdateOne) SetDescription(v string) *PaymentIntentUpdateOne

SetDescription sets the "description" field.

func (*PaymentIntentUpdateOne) SetMetadata

func (_u *PaymentIntentUpdateOne) SetMetadata(v map[string]interface{}) *PaymentIntentUpdateOne

SetMetadata sets the "metadata" field.

func (*PaymentIntentUpdateOne) SetNillableAmount

func (_u *PaymentIntentUpdateOne) SetNillableAmount(v *int64) *PaymentIntentUpdateOne

SetNillableAmount sets the "amount" field if the given value is not nil.

func (*PaymentIntentUpdateOne) SetNillableClientSecret

func (_u *PaymentIntentUpdateOne) SetNillableClientSecret(v *string) *PaymentIntentUpdateOne

SetNillableClientSecret sets the "client_secret" field if the given value is not nil.

func (*PaymentIntentUpdateOne) SetNillableCurrency

func (_u *PaymentIntentUpdateOne) SetNillableCurrency(v *string) *PaymentIntentUpdateOne

SetNillableCurrency sets the "currency" field if the given value is not nil.

func (*PaymentIntentUpdateOne) SetNillableDescription

func (_u *PaymentIntentUpdateOne) SetNillableDescription(v *string) *PaymentIntentUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*PaymentIntentUpdateOne) SetNillableProvider

func (_u *PaymentIntentUpdateOne) SetNillableProvider(v *string) *PaymentIntentUpdateOne

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*PaymentIntentUpdateOne) SetNillableProviderPaymentIntentID

func (_u *PaymentIntentUpdateOne) SetNillableProviderPaymentIntentID(v *string) *PaymentIntentUpdateOne

SetNillableProviderPaymentIntentID sets the "provider_payment_intent_id" field if the given value is not nil.

func (*PaymentIntentUpdateOne) SetNillableStatus

SetNillableStatus sets the "status" field if the given value is not nil.

func (*PaymentIntentUpdateOne) SetProvider

SetProvider sets the "provider" field.

func (*PaymentIntentUpdateOne) SetProviderPaymentIntentID

func (_u *PaymentIntentUpdateOne) SetProviderPaymentIntentID(v string) *PaymentIntentUpdateOne

SetProviderPaymentIntentID sets the "provider_payment_intent_id" field.

func (*PaymentIntentUpdateOne) SetStatus

SetStatus sets the "status" field.

func (*PaymentIntentUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*PaymentIntentUpdateOne) Where

Where appends a list predicates to the PaymentIntentUpdate builder.

type PaymentIntents

type PaymentIntents []*PaymentIntent

PaymentIntents is a parsable slice of PaymentIntent.

type PaymentMethod

type PaymentMethod struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// External payment provider payment method ID
	ProviderPaymentMethodID string `json:"provider_payment_method_id,omitempty"`
	// Payment provider name
	Provider string `json:"provider,omitempty"`
	// Payment method type
	Type paymentmethod.Type `json:"type,omitempty"`
	// Last four digits of card/account
	LastFour string `json:"last_four,omitempty"`
	// Card brand (visa, mastercard, etc.)
	Brand string `json:"brand,omitempty"`
	// Card expiration month
	ExpMonth int `json:"exp_month,omitempty"`
	// Card expiration year
	ExpYear int `json:"exp_year,omitempty"`
	// Whether this is the default payment method
	IsDefault bool `json:"is_default,omitempty"`
	// Additional payment method data
	Metadata map[string]interface{} `json:"metadata,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PaymentMethodQuery when eager-loading is set.
	Edges PaymentMethodEdges `json:"edges"`
	// contains filtered or unexported fields
}

PaymentMethod is the model entity for the PaymentMethod schema.

func (*PaymentMethod) QueryCustomer

func (_m *PaymentMethod) QueryCustomer() *PaymentCustomerQuery

QueryCustomer queries the "customer" edge of the PaymentMethod entity.

func (*PaymentMethod) String

func (_m *PaymentMethod) String() string

String implements the fmt.Stringer.

func (*PaymentMethod) Unwrap

func (_m *PaymentMethod) Unwrap() *PaymentMethod

Unwrap unwraps the PaymentMethod entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*PaymentMethod) Update

func (_m *PaymentMethod) Update() *PaymentMethodUpdateOne

Update returns a builder for updating this PaymentMethod. Note that you need to call PaymentMethod.Unwrap() before calling this method if this PaymentMethod was returned from a transaction, and the transaction was committed or rolled back.

func (*PaymentMethod) Value

func (_m *PaymentMethod) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the PaymentMethod. This includes values selected through modifiers, order, etc.

type PaymentMethodClient

type PaymentMethodClient struct {
	// contains filtered or unexported fields
}

PaymentMethodClient is a client for the PaymentMethod schema.

func NewPaymentMethodClient

func NewPaymentMethodClient(c config) *PaymentMethodClient

NewPaymentMethodClient returns a client for the PaymentMethod from the given config.

func (*PaymentMethodClient) Create

Create returns a builder for creating a PaymentMethod entity.

func (*PaymentMethodClient) CreateBulk

CreateBulk returns a builder for creating a bulk of PaymentMethod entities.

func (*PaymentMethodClient) Delete

Delete returns a delete builder for PaymentMethod.

func (*PaymentMethodClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PaymentMethodClient) DeleteOneID

func (c *PaymentMethodClient) DeleteOneID(id int) *PaymentMethodDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PaymentMethodClient) Get

Get returns a PaymentMethod entity by its id.

func (*PaymentMethodClient) GetX

GetX is like Get, but panics if an error occurs.

func (*PaymentMethodClient) Hooks

func (c *PaymentMethodClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PaymentMethodClient) Intercept

func (c *PaymentMethodClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `paymentmethod.Intercept(f(g(h())))`.

func (*PaymentMethodClient) Interceptors

func (c *PaymentMethodClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PaymentMethodClient) MapCreateBulk

func (c *PaymentMethodClient) MapCreateBulk(slice any, setFunc func(*PaymentMethodCreate, int)) *PaymentMethodCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*PaymentMethodClient) Query

Query returns a query builder for PaymentMethod.

func (*PaymentMethodClient) QueryCustomer

QueryCustomer queries the customer edge of a PaymentMethod.

func (*PaymentMethodClient) Update

Update returns an update builder for PaymentMethod.

func (*PaymentMethodClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*PaymentMethodClient) UpdateOneID

func (c *PaymentMethodClient) UpdateOneID(id int) *PaymentMethodUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PaymentMethodClient) Use

func (c *PaymentMethodClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `paymentmethod.Hooks(f(g(h())))`.

type PaymentMethodCreate

type PaymentMethodCreate struct {
	// contains filtered or unexported fields
}

PaymentMethodCreate is the builder for creating a PaymentMethod entity.

func (*PaymentMethodCreate) Exec

func (_c *PaymentMethodCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PaymentMethodCreate) ExecX

func (_c *PaymentMethodCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PaymentMethodCreate) Mutation

Mutation returns the PaymentMethodMutation object of the builder.

func (*PaymentMethodCreate) Save

Save creates the PaymentMethod in the database.

func (*PaymentMethodCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*PaymentMethodCreate) SetBrand

SetBrand sets the "brand" field.

func (*PaymentMethodCreate) SetCreatedAt

func (_c *PaymentMethodCreate) SetCreatedAt(v time.Time) *PaymentMethodCreate

SetCreatedAt sets the "created_at" field.

func (*PaymentMethodCreate) SetCustomer

SetCustomer sets the "customer" edge to the PaymentCustomer entity.

func (*PaymentMethodCreate) SetCustomerID

func (_c *PaymentMethodCreate) SetCustomerID(id int) *PaymentMethodCreate

SetCustomerID sets the "customer" edge to the PaymentCustomer entity by ID.

func (*PaymentMethodCreate) SetExpMonth

func (_c *PaymentMethodCreate) SetExpMonth(v int) *PaymentMethodCreate

SetExpMonth sets the "exp_month" field.

func (*PaymentMethodCreate) SetExpYear

func (_c *PaymentMethodCreate) SetExpYear(v int) *PaymentMethodCreate

SetExpYear sets the "exp_year" field.

func (*PaymentMethodCreate) SetIsDefault

func (_c *PaymentMethodCreate) SetIsDefault(v bool) *PaymentMethodCreate

SetIsDefault sets the "is_default" field.

func (*PaymentMethodCreate) SetLastFour

func (_c *PaymentMethodCreate) SetLastFour(v string) *PaymentMethodCreate

SetLastFour sets the "last_four" field.

func (*PaymentMethodCreate) SetMetadata

func (_c *PaymentMethodCreate) SetMetadata(v map[string]interface{}) *PaymentMethodCreate

SetMetadata sets the "metadata" field.

func (*PaymentMethodCreate) SetNillableBrand

func (_c *PaymentMethodCreate) SetNillableBrand(v *string) *PaymentMethodCreate

SetNillableBrand sets the "brand" field if the given value is not nil.

func (*PaymentMethodCreate) SetNillableCreatedAt

func (_c *PaymentMethodCreate) SetNillableCreatedAt(v *time.Time) *PaymentMethodCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PaymentMethodCreate) SetNillableExpMonth

func (_c *PaymentMethodCreate) SetNillableExpMonth(v *int) *PaymentMethodCreate

SetNillableExpMonth sets the "exp_month" field if the given value is not nil.

func (*PaymentMethodCreate) SetNillableExpYear

func (_c *PaymentMethodCreate) SetNillableExpYear(v *int) *PaymentMethodCreate

SetNillableExpYear sets the "exp_year" field if the given value is not nil.

func (*PaymentMethodCreate) SetNillableIsDefault

func (_c *PaymentMethodCreate) SetNillableIsDefault(v *bool) *PaymentMethodCreate

SetNillableIsDefault sets the "is_default" field if the given value is not nil.

func (*PaymentMethodCreate) SetNillableLastFour

func (_c *PaymentMethodCreate) SetNillableLastFour(v *string) *PaymentMethodCreate

SetNillableLastFour sets the "last_four" field if the given value is not nil.

func (*PaymentMethodCreate) SetNillableProvider

func (_c *PaymentMethodCreate) SetNillableProvider(v *string) *PaymentMethodCreate

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*PaymentMethodCreate) SetNillableType

func (_c *PaymentMethodCreate) SetNillableType(v *paymentmethod.Type) *PaymentMethodCreate

SetNillableType sets the "type" field if the given value is not nil.

func (*PaymentMethodCreate) SetNillableUpdatedAt

func (_c *PaymentMethodCreate) SetNillableUpdatedAt(v *time.Time) *PaymentMethodCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*PaymentMethodCreate) SetProvider

func (_c *PaymentMethodCreate) SetProvider(v string) *PaymentMethodCreate

SetProvider sets the "provider" field.

func (*PaymentMethodCreate) SetProviderPaymentMethodID

func (_c *PaymentMethodCreate) SetProviderPaymentMethodID(v string) *PaymentMethodCreate

SetProviderPaymentMethodID sets the "provider_payment_method_id" field.

func (*PaymentMethodCreate) SetType

SetType sets the "type" field.

func (*PaymentMethodCreate) SetUpdatedAt

func (_c *PaymentMethodCreate) SetUpdatedAt(v time.Time) *PaymentMethodCreate

SetUpdatedAt sets the "updated_at" field.

type PaymentMethodCreateBulk

type PaymentMethodCreateBulk struct {
	// contains filtered or unexported fields
}

PaymentMethodCreateBulk is the builder for creating many PaymentMethod entities in bulk.

func (*PaymentMethodCreateBulk) Exec

Exec executes the query.

func (*PaymentMethodCreateBulk) ExecX

func (_c *PaymentMethodCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PaymentMethodCreateBulk) Save

Save creates the PaymentMethod entities in the database.

func (*PaymentMethodCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type PaymentMethodDelete

type PaymentMethodDelete struct {
	// contains filtered or unexported fields
}

PaymentMethodDelete is the builder for deleting a PaymentMethod entity.

func (*PaymentMethodDelete) Exec

func (_d *PaymentMethodDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PaymentMethodDelete) ExecX

func (_d *PaymentMethodDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PaymentMethodDelete) Where

Where appends a list predicates to the PaymentMethodDelete builder.

type PaymentMethodDeleteOne

type PaymentMethodDeleteOne struct {
	// contains filtered or unexported fields
}

PaymentMethodDeleteOne is the builder for deleting a single PaymentMethod entity.

func (*PaymentMethodDeleteOne) Exec

Exec executes the deletion query.

func (*PaymentMethodDeleteOne) ExecX

func (_d *PaymentMethodDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PaymentMethodDeleteOne) Where

Where appends a list predicates to the PaymentMethodDelete builder.

type PaymentMethodEdges

type PaymentMethodEdges struct {
	// Payment customer who owns this payment method
	Customer *PaymentCustomer `json:"customer,omitempty"`
	// contains filtered or unexported fields
}

PaymentMethodEdges holds the relations/edges for other nodes in the graph.

func (PaymentMethodEdges) CustomerOrErr

func (e PaymentMethodEdges) CustomerOrErr() (*PaymentCustomer, error)

CustomerOrErr returns the Customer value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type PaymentMethodGroupBy

type PaymentMethodGroupBy struct {
	// contains filtered or unexported fields
}

PaymentMethodGroupBy is the group-by builder for PaymentMethod entities.

func (*PaymentMethodGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*PaymentMethodGroupBy) Bool

func (s *PaymentMethodGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PaymentMethodGroupBy) BoolX

func (s *PaymentMethodGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PaymentMethodGroupBy) Bools

func (s *PaymentMethodGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PaymentMethodGroupBy) BoolsX

func (s *PaymentMethodGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PaymentMethodGroupBy) Float64

func (s *PaymentMethodGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PaymentMethodGroupBy) Float64X

func (s *PaymentMethodGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PaymentMethodGroupBy) Float64s

func (s *PaymentMethodGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PaymentMethodGroupBy) Float64sX

func (s *PaymentMethodGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PaymentMethodGroupBy) Int

func (s *PaymentMethodGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PaymentMethodGroupBy) IntX

func (s *PaymentMethodGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PaymentMethodGroupBy) Ints

func (s *PaymentMethodGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PaymentMethodGroupBy) IntsX

func (s *PaymentMethodGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PaymentMethodGroupBy) Scan

func (_g *PaymentMethodGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PaymentMethodGroupBy) ScanX

func (s *PaymentMethodGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PaymentMethodGroupBy) String

func (s *PaymentMethodGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PaymentMethodGroupBy) StringX

func (s *PaymentMethodGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PaymentMethodGroupBy) Strings

func (s *PaymentMethodGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PaymentMethodGroupBy) StringsX

func (s *PaymentMethodGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PaymentMethodMutation

type PaymentMethodMutation struct {
	// contains filtered or unexported fields
}

PaymentMethodMutation represents an operation that mutates the PaymentMethod nodes in the graph.

func (*PaymentMethodMutation) AddExpMonth

func (m *PaymentMethodMutation) AddExpMonth(i int)

AddExpMonth adds i to the "exp_month" field.

func (*PaymentMethodMutation) AddExpYear

func (m *PaymentMethodMutation) AddExpYear(i int)

AddExpYear adds i to the "exp_year" field.

func (*PaymentMethodMutation) AddField

func (m *PaymentMethodMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*PaymentMethodMutation) AddedEdges

func (m *PaymentMethodMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PaymentMethodMutation) AddedExpMonth

func (m *PaymentMethodMutation) AddedExpMonth() (r int, exists bool)

AddedExpMonth returns the value that was added to the "exp_month" field in this mutation.

func (*PaymentMethodMutation) AddedExpYear

func (m *PaymentMethodMutation) AddedExpYear() (r int, exists bool)

AddedExpYear returns the value that was added to the "exp_year" field in this mutation.

func (*PaymentMethodMutation) AddedField

func (m *PaymentMethodMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*PaymentMethodMutation) AddedFields

func (m *PaymentMethodMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PaymentMethodMutation) AddedIDs

func (m *PaymentMethodMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PaymentMethodMutation) Brand

func (m *PaymentMethodMutation) Brand() (r string, exists bool)

Brand returns the value of the "brand" field in the mutation.

func (*PaymentMethodMutation) BrandCleared

func (m *PaymentMethodMutation) BrandCleared() bool

BrandCleared returns if the "brand" field was cleared in this mutation.

func (*PaymentMethodMutation) ClearBrand

func (m *PaymentMethodMutation) ClearBrand()

ClearBrand clears the value of the "brand" field.

func (*PaymentMethodMutation) ClearCustomer

func (m *PaymentMethodMutation) ClearCustomer()

ClearCustomer clears the "customer" edge to the PaymentCustomer entity.

func (*PaymentMethodMutation) ClearEdge

func (m *PaymentMethodMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*PaymentMethodMutation) ClearExpMonth

func (m *PaymentMethodMutation) ClearExpMonth()

ClearExpMonth clears the value of the "exp_month" field.

func (*PaymentMethodMutation) ClearExpYear

func (m *PaymentMethodMutation) ClearExpYear()

ClearExpYear clears the value of the "exp_year" field.

func (*PaymentMethodMutation) ClearField

func (m *PaymentMethodMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*PaymentMethodMutation) ClearLastFour

func (m *PaymentMethodMutation) ClearLastFour()

ClearLastFour clears the value of the "last_four" field.

func (*PaymentMethodMutation) ClearMetadata

func (m *PaymentMethodMutation) ClearMetadata()

ClearMetadata clears the value of the "metadata" field.

func (*PaymentMethodMutation) ClearedEdges

func (m *PaymentMethodMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PaymentMethodMutation) ClearedFields

func (m *PaymentMethodMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PaymentMethodMutation) Client

func (m PaymentMethodMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*PaymentMethodMutation) CreatedAt

func (m *PaymentMethodMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*PaymentMethodMutation) CustomerCleared

func (m *PaymentMethodMutation) CustomerCleared() bool

CustomerCleared reports if the "customer" edge to the PaymentCustomer entity was cleared.

func (*PaymentMethodMutation) CustomerID

func (m *PaymentMethodMutation) CustomerID() (id int, exists bool)

CustomerID returns the "customer" edge ID in the mutation.

func (*PaymentMethodMutation) CustomerIDs

func (m *PaymentMethodMutation) CustomerIDs() (ids []int)

CustomerIDs returns the "customer" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CustomerID instead. It exists only for internal usage by the builders.

func (*PaymentMethodMutation) EdgeCleared

func (m *PaymentMethodMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PaymentMethodMutation) ExpMonth

func (m *PaymentMethodMutation) ExpMonth() (r int, exists bool)

ExpMonth returns the value of the "exp_month" field in the mutation.

func (*PaymentMethodMutation) ExpMonthCleared

func (m *PaymentMethodMutation) ExpMonthCleared() bool

ExpMonthCleared returns if the "exp_month" field was cleared in this mutation.

func (*PaymentMethodMutation) ExpYear

func (m *PaymentMethodMutation) ExpYear() (r int, exists bool)

ExpYear returns the value of the "exp_year" field in the mutation.

func (*PaymentMethodMutation) ExpYearCleared

func (m *PaymentMethodMutation) ExpYearCleared() bool

ExpYearCleared returns if the "exp_year" field was cleared in this mutation.

func (*PaymentMethodMutation) Field

func (m *PaymentMethodMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*PaymentMethodMutation) FieldCleared

func (m *PaymentMethodMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PaymentMethodMutation) Fields

func (m *PaymentMethodMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*PaymentMethodMutation) GetType

func (m *PaymentMethodMutation) GetType() (r paymentmethod.Type, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*PaymentMethodMutation) ID

func (m *PaymentMethodMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*PaymentMethodMutation) IDs

func (m *PaymentMethodMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*PaymentMethodMutation) IsDefault

func (m *PaymentMethodMutation) IsDefault() (r bool, exists bool)

IsDefault returns the value of the "is_default" field in the mutation.

func (*PaymentMethodMutation) LastFour

func (m *PaymentMethodMutation) LastFour() (r string, exists bool)

LastFour returns the value of the "last_four" field in the mutation.

func (*PaymentMethodMutation) LastFourCleared

func (m *PaymentMethodMutation) LastFourCleared() bool

LastFourCleared returns if the "last_four" field was cleared in this mutation.

func (*PaymentMethodMutation) Metadata

func (m *PaymentMethodMutation) Metadata() (r map[string]interface{}, exists bool)

Metadata returns the value of the "metadata" field in the mutation.

func (*PaymentMethodMutation) MetadataCleared

func (m *PaymentMethodMutation) MetadataCleared() bool

MetadataCleared returns if the "metadata" field was cleared in this mutation.

func (*PaymentMethodMutation) OldBrand

func (m *PaymentMethodMutation) OldBrand(ctx context.Context) (v string, err error)

OldBrand returns the old "brand" field's value of the PaymentMethod entity. If the PaymentMethod object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentMethodMutation) OldCreatedAt

func (m *PaymentMethodMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the PaymentMethod entity. If the PaymentMethod object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentMethodMutation) OldExpMonth

func (m *PaymentMethodMutation) OldExpMonth(ctx context.Context) (v int, err error)

OldExpMonth returns the old "exp_month" field's value of the PaymentMethod entity. If the PaymentMethod object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentMethodMutation) OldExpYear

func (m *PaymentMethodMutation) OldExpYear(ctx context.Context) (v int, err error)

OldExpYear returns the old "exp_year" field's value of the PaymentMethod entity. If the PaymentMethod object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentMethodMutation) OldField

func (m *PaymentMethodMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*PaymentMethodMutation) OldIsDefault

func (m *PaymentMethodMutation) OldIsDefault(ctx context.Context) (v bool, err error)

OldIsDefault returns the old "is_default" field's value of the PaymentMethod entity. If the PaymentMethod object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentMethodMutation) OldLastFour

func (m *PaymentMethodMutation) OldLastFour(ctx context.Context) (v string, err error)

OldLastFour returns the old "last_four" field's value of the PaymentMethod entity. If the PaymentMethod object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentMethodMutation) OldMetadata

func (m *PaymentMethodMutation) OldMetadata(ctx context.Context) (v map[string]interface{}, err error)

OldMetadata returns the old "metadata" field's value of the PaymentMethod entity. If the PaymentMethod object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentMethodMutation) OldProvider

func (m *PaymentMethodMutation) OldProvider(ctx context.Context) (v string, err error)

OldProvider returns the old "provider" field's value of the PaymentMethod entity. If the PaymentMethod object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentMethodMutation) OldProviderPaymentMethodID

func (m *PaymentMethodMutation) OldProviderPaymentMethodID(ctx context.Context) (v string, err error)

OldProviderPaymentMethodID returns the old "provider_payment_method_id" field's value of the PaymentMethod entity. If the PaymentMethod object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentMethodMutation) OldType

func (m *PaymentMethodMutation) OldType(ctx context.Context) (v paymentmethod.Type, err error)

OldType returns the old "type" field's value of the PaymentMethod entity. If the PaymentMethod object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentMethodMutation) OldUpdatedAt

func (m *PaymentMethodMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the PaymentMethod entity. If the PaymentMethod object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentMethodMutation) Op

func (m *PaymentMethodMutation) Op() Op

Op returns the operation name.

func (*PaymentMethodMutation) Provider

func (m *PaymentMethodMutation) Provider() (r string, exists bool)

Provider returns the value of the "provider" field in the mutation.

func (*PaymentMethodMutation) ProviderPaymentMethodID

func (m *PaymentMethodMutation) ProviderPaymentMethodID() (r string, exists bool)

ProviderPaymentMethodID returns the value of the "provider_payment_method_id" field in the mutation.

func (*PaymentMethodMutation) RemovedEdges

func (m *PaymentMethodMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PaymentMethodMutation) RemovedIDs

func (m *PaymentMethodMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*PaymentMethodMutation) ResetBrand

func (m *PaymentMethodMutation) ResetBrand()

ResetBrand resets all changes to the "brand" field.

func (*PaymentMethodMutation) ResetCreatedAt

func (m *PaymentMethodMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PaymentMethodMutation) ResetCustomer

func (m *PaymentMethodMutation) ResetCustomer()

ResetCustomer resets all changes to the "customer" edge.

func (*PaymentMethodMutation) ResetEdge

func (m *PaymentMethodMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*PaymentMethodMutation) ResetExpMonth

func (m *PaymentMethodMutation) ResetExpMonth()

ResetExpMonth resets all changes to the "exp_month" field.

func (*PaymentMethodMutation) ResetExpYear

func (m *PaymentMethodMutation) ResetExpYear()

ResetExpYear resets all changes to the "exp_year" field.

func (*PaymentMethodMutation) ResetField

func (m *PaymentMethodMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*PaymentMethodMutation) ResetIsDefault

func (m *PaymentMethodMutation) ResetIsDefault()

ResetIsDefault resets all changes to the "is_default" field.

func (*PaymentMethodMutation) ResetLastFour

func (m *PaymentMethodMutation) ResetLastFour()

ResetLastFour resets all changes to the "last_four" field.

func (*PaymentMethodMutation) ResetMetadata

func (m *PaymentMethodMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" field.

func (*PaymentMethodMutation) ResetProvider

func (m *PaymentMethodMutation) ResetProvider()

ResetProvider resets all changes to the "provider" field.

func (*PaymentMethodMutation) ResetProviderPaymentMethodID

func (m *PaymentMethodMutation) ResetProviderPaymentMethodID()

ResetProviderPaymentMethodID resets all changes to the "provider_payment_method_id" field.

func (*PaymentMethodMutation) ResetType

func (m *PaymentMethodMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*PaymentMethodMutation) ResetUpdatedAt

func (m *PaymentMethodMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*PaymentMethodMutation) SetBrand

func (m *PaymentMethodMutation) SetBrand(s string)

SetBrand sets the "brand" field.

func (*PaymentMethodMutation) SetCreatedAt

func (m *PaymentMethodMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*PaymentMethodMutation) SetCustomerID

func (m *PaymentMethodMutation) SetCustomerID(id int)

SetCustomerID sets the "customer" edge to the PaymentCustomer entity by id.

func (*PaymentMethodMutation) SetExpMonth

func (m *PaymentMethodMutation) SetExpMonth(i int)

SetExpMonth sets the "exp_month" field.

func (*PaymentMethodMutation) SetExpYear

func (m *PaymentMethodMutation) SetExpYear(i int)

SetExpYear sets the "exp_year" field.

func (*PaymentMethodMutation) SetField

func (m *PaymentMethodMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*PaymentMethodMutation) SetIsDefault

func (m *PaymentMethodMutation) SetIsDefault(b bool)

SetIsDefault sets the "is_default" field.

func (*PaymentMethodMutation) SetLastFour

func (m *PaymentMethodMutation) SetLastFour(s string)

SetLastFour sets the "last_four" field.

func (*PaymentMethodMutation) SetMetadata

func (m *PaymentMethodMutation) SetMetadata(value map[string]interface{})

SetMetadata sets the "metadata" field.

func (*PaymentMethodMutation) SetOp

func (m *PaymentMethodMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PaymentMethodMutation) SetProvider

func (m *PaymentMethodMutation) SetProvider(s string)

SetProvider sets the "provider" field.

func (*PaymentMethodMutation) SetProviderPaymentMethodID

func (m *PaymentMethodMutation) SetProviderPaymentMethodID(s string)

SetProviderPaymentMethodID sets the "provider_payment_method_id" field.

func (*PaymentMethodMutation) SetType

func (m *PaymentMethodMutation) SetType(pa paymentmethod.Type)

SetType sets the "type" field.

func (*PaymentMethodMutation) SetUpdatedAt

func (m *PaymentMethodMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (PaymentMethodMutation) Tx

func (m PaymentMethodMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PaymentMethodMutation) Type

func (m *PaymentMethodMutation) Type() string

Type returns the node type of this mutation (PaymentMethod).

func (*PaymentMethodMutation) UpdatedAt

func (m *PaymentMethodMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*PaymentMethodMutation) Where

Where appends a list predicates to the PaymentMethodMutation builder.

func (*PaymentMethodMutation) WhereP

func (m *PaymentMethodMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PaymentMethodMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PaymentMethodQuery

type PaymentMethodQuery struct {
	// contains filtered or unexported fields
}

PaymentMethodQuery is the builder for querying PaymentMethod entities.

func (*PaymentMethodQuery) Aggregate

func (_q *PaymentMethodQuery) Aggregate(fns ...AggregateFunc) *PaymentMethodSelect

Aggregate returns a PaymentMethodSelect configured with the given aggregations.

func (*PaymentMethodQuery) All

All executes the query and returns a list of PaymentMethods.

func (*PaymentMethodQuery) AllX

AllX is like All, but panics if an error occurs.

func (*PaymentMethodQuery) Clone

Clone returns a duplicate of the PaymentMethodQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PaymentMethodQuery) Count

func (_q *PaymentMethodQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PaymentMethodQuery) CountX

func (_q *PaymentMethodQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PaymentMethodQuery) Exist

func (_q *PaymentMethodQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PaymentMethodQuery) ExistX

func (_q *PaymentMethodQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PaymentMethodQuery) First

First returns the first PaymentMethod entity from the query. Returns a *NotFoundError when no PaymentMethod was found.

func (*PaymentMethodQuery) FirstID

func (_q *PaymentMethodQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first PaymentMethod ID from the query. Returns a *NotFoundError when no PaymentMethod ID was found.

func (*PaymentMethodQuery) FirstIDX

func (_q *PaymentMethodQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*PaymentMethodQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*PaymentMethodQuery) GroupBy

func (_q *PaymentMethodQuery) GroupBy(field string, fields ...string) *PaymentMethodGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	ProviderPaymentMethodID string `json:"provider_payment_method_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.PaymentMethod.Query().
	GroupBy(paymentmethod.FieldProviderPaymentMethodID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PaymentMethodQuery) IDs

func (_q *PaymentMethodQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of PaymentMethod IDs.

func (*PaymentMethodQuery) IDsX

func (_q *PaymentMethodQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*PaymentMethodQuery) Limit

func (_q *PaymentMethodQuery) Limit(limit int) *PaymentMethodQuery

Limit the number of records to be returned by this query.

func (*PaymentMethodQuery) Offset

func (_q *PaymentMethodQuery) Offset(offset int) *PaymentMethodQuery

Offset to start from.

func (*PaymentMethodQuery) Only

Only returns a single PaymentMethod entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one PaymentMethod entity is found. Returns a *NotFoundError when no PaymentMethod entities are found.

func (*PaymentMethodQuery) OnlyID

func (_q *PaymentMethodQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only PaymentMethod ID in the query. Returns a *NotSingularError when more than one PaymentMethod ID is found. Returns a *NotFoundError when no entities are found.

func (*PaymentMethodQuery) OnlyIDX

func (_q *PaymentMethodQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PaymentMethodQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*PaymentMethodQuery) Order

Order specifies how the records should be ordered.

func (*PaymentMethodQuery) QueryCustomer

func (_q *PaymentMethodQuery) QueryCustomer() *PaymentCustomerQuery

QueryCustomer chains the current query on the "customer" edge.

func (*PaymentMethodQuery) Select

func (_q *PaymentMethodQuery) Select(fields ...string) *PaymentMethodSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	ProviderPaymentMethodID string `json:"provider_payment_method_id,omitempty"`
}

client.PaymentMethod.Query().
	Select(paymentmethod.FieldProviderPaymentMethodID).
	Scan(ctx, &v)

func (*PaymentMethodQuery) Unique

func (_q *PaymentMethodQuery) Unique(unique bool) *PaymentMethodQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*PaymentMethodQuery) Where

Where adds a new predicate for the PaymentMethodQuery builder.

func (*PaymentMethodQuery) WithCustomer

func (_q *PaymentMethodQuery) WithCustomer(opts ...func(*PaymentCustomerQuery)) *PaymentMethodQuery

WithCustomer tells the query-builder to eager-load the nodes that are connected to the "customer" edge. The optional arguments are used to configure the query builder of the edge.

type PaymentMethodSelect

type PaymentMethodSelect struct {
	*PaymentMethodQuery
	// contains filtered or unexported fields
}

PaymentMethodSelect is the builder for selecting fields of PaymentMethod entities.

func (*PaymentMethodSelect) Aggregate

func (_s *PaymentMethodSelect) Aggregate(fns ...AggregateFunc) *PaymentMethodSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PaymentMethodSelect) Bool

func (s *PaymentMethodSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PaymentMethodSelect) BoolX

func (s *PaymentMethodSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PaymentMethodSelect) Bools

func (s *PaymentMethodSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PaymentMethodSelect) BoolsX

func (s *PaymentMethodSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PaymentMethodSelect) Float64

func (s *PaymentMethodSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PaymentMethodSelect) Float64X

func (s *PaymentMethodSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PaymentMethodSelect) Float64s

func (s *PaymentMethodSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PaymentMethodSelect) Float64sX

func (s *PaymentMethodSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PaymentMethodSelect) Int

func (s *PaymentMethodSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PaymentMethodSelect) IntX

func (s *PaymentMethodSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PaymentMethodSelect) Ints

func (s *PaymentMethodSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PaymentMethodSelect) IntsX

func (s *PaymentMethodSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PaymentMethodSelect) Scan

func (_s *PaymentMethodSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PaymentMethodSelect) ScanX

func (s *PaymentMethodSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PaymentMethodSelect) String

func (s *PaymentMethodSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PaymentMethodSelect) StringX

func (s *PaymentMethodSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PaymentMethodSelect) Strings

func (s *PaymentMethodSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PaymentMethodSelect) StringsX

func (s *PaymentMethodSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PaymentMethodUpdate

type PaymentMethodUpdate struct {
	// contains filtered or unexported fields
}

PaymentMethodUpdate is the builder for updating PaymentMethod entities.

func (*PaymentMethodUpdate) AddExpMonth

func (_u *PaymentMethodUpdate) AddExpMonth(v int) *PaymentMethodUpdate

AddExpMonth adds value to the "exp_month" field.

func (*PaymentMethodUpdate) AddExpYear

func (_u *PaymentMethodUpdate) AddExpYear(v int) *PaymentMethodUpdate

AddExpYear adds value to the "exp_year" field.

func (*PaymentMethodUpdate) ClearBrand

func (_u *PaymentMethodUpdate) ClearBrand() *PaymentMethodUpdate

ClearBrand clears the value of the "brand" field.

func (*PaymentMethodUpdate) ClearCustomer

func (_u *PaymentMethodUpdate) ClearCustomer() *PaymentMethodUpdate

ClearCustomer clears the "customer" edge to the PaymentCustomer entity.

func (*PaymentMethodUpdate) ClearExpMonth

func (_u *PaymentMethodUpdate) ClearExpMonth() *PaymentMethodUpdate

ClearExpMonth clears the value of the "exp_month" field.

func (*PaymentMethodUpdate) ClearExpYear

func (_u *PaymentMethodUpdate) ClearExpYear() *PaymentMethodUpdate

ClearExpYear clears the value of the "exp_year" field.

func (*PaymentMethodUpdate) ClearLastFour

func (_u *PaymentMethodUpdate) ClearLastFour() *PaymentMethodUpdate

ClearLastFour clears the value of the "last_four" field.

func (*PaymentMethodUpdate) ClearMetadata

func (_u *PaymentMethodUpdate) ClearMetadata() *PaymentMethodUpdate

ClearMetadata clears the value of the "metadata" field.

func (*PaymentMethodUpdate) Exec

func (_u *PaymentMethodUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PaymentMethodUpdate) ExecX

func (_u *PaymentMethodUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PaymentMethodUpdate) Mutation

Mutation returns the PaymentMethodMutation object of the builder.

func (*PaymentMethodUpdate) Save

func (_u *PaymentMethodUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PaymentMethodUpdate) SaveX

func (_u *PaymentMethodUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PaymentMethodUpdate) SetBrand

SetBrand sets the "brand" field.

func (*PaymentMethodUpdate) SetCustomer

SetCustomer sets the "customer" edge to the PaymentCustomer entity.

func (*PaymentMethodUpdate) SetCustomerID

func (_u *PaymentMethodUpdate) SetCustomerID(id int) *PaymentMethodUpdate

SetCustomerID sets the "customer" edge to the PaymentCustomer entity by ID.

func (*PaymentMethodUpdate) SetExpMonth

func (_u *PaymentMethodUpdate) SetExpMonth(v int) *PaymentMethodUpdate

SetExpMonth sets the "exp_month" field.

func (*PaymentMethodUpdate) SetExpYear

func (_u *PaymentMethodUpdate) SetExpYear(v int) *PaymentMethodUpdate

SetExpYear sets the "exp_year" field.

func (*PaymentMethodUpdate) SetIsDefault

func (_u *PaymentMethodUpdate) SetIsDefault(v bool) *PaymentMethodUpdate

SetIsDefault sets the "is_default" field.

func (*PaymentMethodUpdate) SetLastFour

func (_u *PaymentMethodUpdate) SetLastFour(v string) *PaymentMethodUpdate

SetLastFour sets the "last_four" field.

func (*PaymentMethodUpdate) SetMetadata

func (_u *PaymentMethodUpdate) SetMetadata(v map[string]interface{}) *PaymentMethodUpdate

SetMetadata sets the "metadata" field.

func (*PaymentMethodUpdate) SetNillableBrand

func (_u *PaymentMethodUpdate) SetNillableBrand(v *string) *PaymentMethodUpdate

SetNillableBrand sets the "brand" field if the given value is not nil.

func (*PaymentMethodUpdate) SetNillableExpMonth

func (_u *PaymentMethodUpdate) SetNillableExpMonth(v *int) *PaymentMethodUpdate

SetNillableExpMonth sets the "exp_month" field if the given value is not nil.

func (*PaymentMethodUpdate) SetNillableExpYear

func (_u *PaymentMethodUpdate) SetNillableExpYear(v *int) *PaymentMethodUpdate

SetNillableExpYear sets the "exp_year" field if the given value is not nil.

func (*PaymentMethodUpdate) SetNillableIsDefault

func (_u *PaymentMethodUpdate) SetNillableIsDefault(v *bool) *PaymentMethodUpdate

SetNillableIsDefault sets the "is_default" field if the given value is not nil.

func (*PaymentMethodUpdate) SetNillableLastFour

func (_u *PaymentMethodUpdate) SetNillableLastFour(v *string) *PaymentMethodUpdate

SetNillableLastFour sets the "last_four" field if the given value is not nil.

func (*PaymentMethodUpdate) SetNillableProvider

func (_u *PaymentMethodUpdate) SetNillableProvider(v *string) *PaymentMethodUpdate

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*PaymentMethodUpdate) SetNillableProviderPaymentMethodID

func (_u *PaymentMethodUpdate) SetNillableProviderPaymentMethodID(v *string) *PaymentMethodUpdate

SetNillableProviderPaymentMethodID sets the "provider_payment_method_id" field if the given value is not nil.

func (*PaymentMethodUpdate) SetNillableType

func (_u *PaymentMethodUpdate) SetNillableType(v *paymentmethod.Type) *PaymentMethodUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*PaymentMethodUpdate) SetProvider

func (_u *PaymentMethodUpdate) SetProvider(v string) *PaymentMethodUpdate

SetProvider sets the "provider" field.

func (*PaymentMethodUpdate) SetProviderPaymentMethodID

func (_u *PaymentMethodUpdate) SetProviderPaymentMethodID(v string) *PaymentMethodUpdate

SetProviderPaymentMethodID sets the "provider_payment_method_id" field.

func (*PaymentMethodUpdate) SetType

SetType sets the "type" field.

func (*PaymentMethodUpdate) SetUpdatedAt

func (_u *PaymentMethodUpdate) SetUpdatedAt(v time.Time) *PaymentMethodUpdate

SetUpdatedAt sets the "updated_at" field.

func (*PaymentMethodUpdate) Where

Where appends a list predicates to the PaymentMethodUpdate builder.

type PaymentMethodUpdateOne

type PaymentMethodUpdateOne struct {
	// contains filtered or unexported fields
}

PaymentMethodUpdateOne is the builder for updating a single PaymentMethod entity.

func (*PaymentMethodUpdateOne) AddExpMonth

AddExpMonth adds value to the "exp_month" field.

func (*PaymentMethodUpdateOne) AddExpYear

AddExpYear adds value to the "exp_year" field.

func (*PaymentMethodUpdateOne) ClearBrand

ClearBrand clears the value of the "brand" field.

func (*PaymentMethodUpdateOne) ClearCustomer

func (_u *PaymentMethodUpdateOne) ClearCustomer() *PaymentMethodUpdateOne

ClearCustomer clears the "customer" edge to the PaymentCustomer entity.

func (*PaymentMethodUpdateOne) ClearExpMonth

func (_u *PaymentMethodUpdateOne) ClearExpMonth() *PaymentMethodUpdateOne

ClearExpMonth clears the value of the "exp_month" field.

func (*PaymentMethodUpdateOne) ClearExpYear

func (_u *PaymentMethodUpdateOne) ClearExpYear() *PaymentMethodUpdateOne

ClearExpYear clears the value of the "exp_year" field.

func (*PaymentMethodUpdateOne) ClearLastFour

func (_u *PaymentMethodUpdateOne) ClearLastFour() *PaymentMethodUpdateOne

ClearLastFour clears the value of the "last_four" field.

func (*PaymentMethodUpdateOne) ClearMetadata

func (_u *PaymentMethodUpdateOne) ClearMetadata() *PaymentMethodUpdateOne

ClearMetadata clears the value of the "metadata" field.

func (*PaymentMethodUpdateOne) Exec

Exec executes the query on the entity.

func (*PaymentMethodUpdateOne) ExecX

func (_u *PaymentMethodUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PaymentMethodUpdateOne) Mutation

Mutation returns the PaymentMethodMutation object of the builder.

func (*PaymentMethodUpdateOne) Save

Save executes the query and returns the updated PaymentMethod entity.

func (*PaymentMethodUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*PaymentMethodUpdateOne) Select

func (_u *PaymentMethodUpdateOne) Select(field string, fields ...string) *PaymentMethodUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PaymentMethodUpdateOne) SetBrand

SetBrand sets the "brand" field.

func (*PaymentMethodUpdateOne) SetCustomer

SetCustomer sets the "customer" edge to the PaymentCustomer entity.

func (*PaymentMethodUpdateOne) SetCustomerID

func (_u *PaymentMethodUpdateOne) SetCustomerID(id int) *PaymentMethodUpdateOne

SetCustomerID sets the "customer" edge to the PaymentCustomer entity by ID.

func (*PaymentMethodUpdateOne) SetExpMonth

SetExpMonth sets the "exp_month" field.

func (*PaymentMethodUpdateOne) SetExpYear

SetExpYear sets the "exp_year" field.

func (*PaymentMethodUpdateOne) SetIsDefault

func (_u *PaymentMethodUpdateOne) SetIsDefault(v bool) *PaymentMethodUpdateOne

SetIsDefault sets the "is_default" field.

func (*PaymentMethodUpdateOne) SetLastFour

SetLastFour sets the "last_four" field.

func (*PaymentMethodUpdateOne) SetMetadata

func (_u *PaymentMethodUpdateOne) SetMetadata(v map[string]interface{}) *PaymentMethodUpdateOne

SetMetadata sets the "metadata" field.

func (*PaymentMethodUpdateOne) SetNillableBrand

func (_u *PaymentMethodUpdateOne) SetNillableBrand(v *string) *PaymentMethodUpdateOne

SetNillableBrand sets the "brand" field if the given value is not nil.

func (*PaymentMethodUpdateOne) SetNillableExpMonth

func (_u *PaymentMethodUpdateOne) SetNillableExpMonth(v *int) *PaymentMethodUpdateOne

SetNillableExpMonth sets the "exp_month" field if the given value is not nil.

func (*PaymentMethodUpdateOne) SetNillableExpYear

func (_u *PaymentMethodUpdateOne) SetNillableExpYear(v *int) *PaymentMethodUpdateOne

SetNillableExpYear sets the "exp_year" field if the given value is not nil.

func (*PaymentMethodUpdateOne) SetNillableIsDefault

func (_u *PaymentMethodUpdateOne) SetNillableIsDefault(v *bool) *PaymentMethodUpdateOne

SetNillableIsDefault sets the "is_default" field if the given value is not nil.

func (*PaymentMethodUpdateOne) SetNillableLastFour

func (_u *PaymentMethodUpdateOne) SetNillableLastFour(v *string) *PaymentMethodUpdateOne

SetNillableLastFour sets the "last_four" field if the given value is not nil.

func (*PaymentMethodUpdateOne) SetNillableProvider

func (_u *PaymentMethodUpdateOne) SetNillableProvider(v *string) *PaymentMethodUpdateOne

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*PaymentMethodUpdateOne) SetNillableProviderPaymentMethodID

func (_u *PaymentMethodUpdateOne) SetNillableProviderPaymentMethodID(v *string) *PaymentMethodUpdateOne

SetNillableProviderPaymentMethodID sets the "provider_payment_method_id" field if the given value is not nil.

func (*PaymentMethodUpdateOne) SetNillableType

SetNillableType sets the "type" field if the given value is not nil.

func (*PaymentMethodUpdateOne) SetProvider

SetProvider sets the "provider" field.

func (*PaymentMethodUpdateOne) SetProviderPaymentMethodID

func (_u *PaymentMethodUpdateOne) SetProviderPaymentMethodID(v string) *PaymentMethodUpdateOne

SetProviderPaymentMethodID sets the "provider_payment_method_id" field.

func (*PaymentMethodUpdateOne) SetType

SetType sets the "type" field.

func (*PaymentMethodUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*PaymentMethodUpdateOne) Where

Where appends a list predicates to the PaymentMethodUpdate builder.

type PaymentMethods

type PaymentMethods []*PaymentMethod

PaymentMethods is a parsable slice of PaymentMethod.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type Subscription

type Subscription struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// External payment provider subscription ID
	ProviderSubscriptionID string `json:"provider_subscription_id,omitempty"`
	// Payment provider name
	Provider string `json:"provider,omitempty"`
	// Subscription status from provider
	Status subscription.Status `json:"status,omitempty"`
	// Price/plan ID from payment provider
	PriceID string `json:"price_id,omitempty"`
	// Subscription amount in smallest currency unit
	Amount int64 `json:"amount,omitempty"`
	// Three-letter ISO currency code
	Currency string `json:"currency,omitempty"`
	// Billing interval
	Interval subscription.Interval `json:"interval,omitempty"`
	// Number of intervals between billings
	IntervalCount int `json:"interval_count,omitempty"`
	// Start of current billing period
	CurrentPeriodStart time.Time `json:"current_period_start,omitempty"`
	// End of current billing period
	CurrentPeriodEnd time.Time `json:"current_period_end,omitempty"`
	// Trial period start
	TrialStart time.Time `json:"trial_start,omitempty"`
	// Trial period end
	TrialEnd time.Time `json:"trial_end,omitempty"`
	// When subscription was canceled
	CanceledAt time.Time `json:"canceled_at,omitempty"`
	// When subscription ended
	EndedAt time.Time `json:"ended_at,omitempty"`
	// Additional subscription data
	Metadata map[string]interface{} `json:"metadata,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SubscriptionQuery when eager-loading is set.
	Edges SubscriptionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Subscription is the model entity for the Subscription schema.

func (*Subscription) QueryCustomer

func (_m *Subscription) QueryCustomer() *PaymentCustomerQuery

QueryCustomer queries the "customer" edge of the Subscription entity.

func (*Subscription) String

func (_m *Subscription) String() string

String implements the fmt.Stringer.

func (*Subscription) Unwrap

func (_m *Subscription) Unwrap() *Subscription

Unwrap unwraps the Subscription entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Subscription) Update

func (_m *Subscription) Update() *SubscriptionUpdateOne

Update returns a builder for updating this Subscription. Note that you need to call Subscription.Unwrap() before calling this method if this Subscription was returned from a transaction, and the transaction was committed or rolled back.

func (*Subscription) Value

func (_m *Subscription) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Subscription. This includes values selected through modifiers, order, etc.

type SubscriptionClient

type SubscriptionClient struct {
	// contains filtered or unexported fields
}

SubscriptionClient is a client for the Subscription schema.

func NewSubscriptionClient

func NewSubscriptionClient(c config) *SubscriptionClient

NewSubscriptionClient returns a client for the Subscription from the given config.

func (*SubscriptionClient) Create

Create returns a builder for creating a Subscription entity.

func (*SubscriptionClient) CreateBulk

func (c *SubscriptionClient) CreateBulk(builders ...*SubscriptionCreate) *SubscriptionCreateBulk

CreateBulk returns a builder for creating a bulk of Subscription entities.

func (*SubscriptionClient) Delete

Delete returns a delete builder for Subscription.

func (*SubscriptionClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SubscriptionClient) DeleteOneID

func (c *SubscriptionClient) DeleteOneID(id int) *SubscriptionDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SubscriptionClient) Get

Get returns a Subscription entity by its id.

func (*SubscriptionClient) GetX

GetX is like Get, but panics if an error occurs.

func (*SubscriptionClient) Hooks

func (c *SubscriptionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SubscriptionClient) Intercept

func (c *SubscriptionClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `subscription.Intercept(f(g(h())))`.

func (*SubscriptionClient) Interceptors

func (c *SubscriptionClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*SubscriptionClient) MapCreateBulk

func (c *SubscriptionClient) MapCreateBulk(slice any, setFunc func(*SubscriptionCreate, int)) *SubscriptionCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*SubscriptionClient) Query

Query returns a query builder for Subscription.

func (*SubscriptionClient) QueryCustomer

func (c *SubscriptionClient) QueryCustomer(_m *Subscription) *PaymentCustomerQuery

QueryCustomer queries the customer edge of a Subscription.

func (*SubscriptionClient) Update

Update returns an update builder for Subscription.

func (*SubscriptionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*SubscriptionClient) UpdateOneID

func (c *SubscriptionClient) UpdateOneID(id int) *SubscriptionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SubscriptionClient) Use

func (c *SubscriptionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `subscription.Hooks(f(g(h())))`.

type SubscriptionCreate

type SubscriptionCreate struct {
	// contains filtered or unexported fields
}

SubscriptionCreate is the builder for creating a Subscription entity.

func (*SubscriptionCreate) Exec

func (_c *SubscriptionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SubscriptionCreate) ExecX

func (_c *SubscriptionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SubscriptionCreate) Mutation

func (_c *SubscriptionCreate) Mutation() *SubscriptionMutation

Mutation returns the SubscriptionMutation object of the builder.

func (*SubscriptionCreate) Save

Save creates the Subscription in the database.

func (*SubscriptionCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*SubscriptionCreate) SetAmount

func (_c *SubscriptionCreate) SetAmount(v int64) *SubscriptionCreate

SetAmount sets the "amount" field.

func (*SubscriptionCreate) SetCanceledAt

func (_c *SubscriptionCreate) SetCanceledAt(v time.Time) *SubscriptionCreate

SetCanceledAt sets the "canceled_at" field.

func (*SubscriptionCreate) SetCreatedAt

func (_c *SubscriptionCreate) SetCreatedAt(v time.Time) *SubscriptionCreate

SetCreatedAt sets the "created_at" field.

func (*SubscriptionCreate) SetCurrency

func (_c *SubscriptionCreate) SetCurrency(v string) *SubscriptionCreate

SetCurrency sets the "currency" field.

func (*SubscriptionCreate) SetCurrentPeriodEnd

func (_c *SubscriptionCreate) SetCurrentPeriodEnd(v time.Time) *SubscriptionCreate

SetCurrentPeriodEnd sets the "current_period_end" field.

func (*SubscriptionCreate) SetCurrentPeriodStart

func (_c *SubscriptionCreate) SetCurrentPeriodStart(v time.Time) *SubscriptionCreate

SetCurrentPeriodStart sets the "current_period_start" field.

func (*SubscriptionCreate) SetCustomer

SetCustomer sets the "customer" edge to the PaymentCustomer entity.

func (*SubscriptionCreate) SetCustomerID

func (_c *SubscriptionCreate) SetCustomerID(id int) *SubscriptionCreate

SetCustomerID sets the "customer" edge to the PaymentCustomer entity by ID.

func (*SubscriptionCreate) SetEndedAt

func (_c *SubscriptionCreate) SetEndedAt(v time.Time) *SubscriptionCreate

SetEndedAt sets the "ended_at" field.

func (*SubscriptionCreate) SetInterval

SetInterval sets the "interval" field.

func (*SubscriptionCreate) SetIntervalCount

func (_c *SubscriptionCreate) SetIntervalCount(v int) *SubscriptionCreate

SetIntervalCount sets the "interval_count" field.

func (*SubscriptionCreate) SetMetadata

func (_c *SubscriptionCreate) SetMetadata(v map[string]interface{}) *SubscriptionCreate

SetMetadata sets the "metadata" field.

func (*SubscriptionCreate) SetNillableCanceledAt

func (_c *SubscriptionCreate) SetNillableCanceledAt(v *time.Time) *SubscriptionCreate

SetNillableCanceledAt sets the "canceled_at" field if the given value is not nil.

func (*SubscriptionCreate) SetNillableCreatedAt

func (_c *SubscriptionCreate) SetNillableCreatedAt(v *time.Time) *SubscriptionCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*SubscriptionCreate) SetNillableCurrency

func (_c *SubscriptionCreate) SetNillableCurrency(v *string) *SubscriptionCreate

SetNillableCurrency sets the "currency" field if the given value is not nil.

func (*SubscriptionCreate) SetNillableCurrentPeriodEnd

func (_c *SubscriptionCreate) SetNillableCurrentPeriodEnd(v *time.Time) *SubscriptionCreate

SetNillableCurrentPeriodEnd sets the "current_period_end" field if the given value is not nil.

func (*SubscriptionCreate) SetNillableCurrentPeriodStart

func (_c *SubscriptionCreate) SetNillableCurrentPeriodStart(v *time.Time) *SubscriptionCreate

SetNillableCurrentPeriodStart sets the "current_period_start" field if the given value is not nil.

func (*SubscriptionCreate) SetNillableEndedAt

func (_c *SubscriptionCreate) SetNillableEndedAt(v *time.Time) *SubscriptionCreate

SetNillableEndedAt sets the "ended_at" field if the given value is not nil.

func (*SubscriptionCreate) SetNillableIntervalCount

func (_c *SubscriptionCreate) SetNillableIntervalCount(v *int) *SubscriptionCreate

SetNillableIntervalCount sets the "interval_count" field if the given value is not nil.

func (*SubscriptionCreate) SetNillableProvider

func (_c *SubscriptionCreate) SetNillableProvider(v *string) *SubscriptionCreate

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*SubscriptionCreate) SetNillableStatus

func (_c *SubscriptionCreate) SetNillableStatus(v *subscription.Status) *SubscriptionCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*SubscriptionCreate) SetNillableTrialEnd

func (_c *SubscriptionCreate) SetNillableTrialEnd(v *time.Time) *SubscriptionCreate

SetNillableTrialEnd sets the "trial_end" field if the given value is not nil.

func (*SubscriptionCreate) SetNillableTrialStart

func (_c *SubscriptionCreate) SetNillableTrialStart(v *time.Time) *SubscriptionCreate

SetNillableTrialStart sets the "trial_start" field if the given value is not nil.

func (*SubscriptionCreate) SetNillableUpdatedAt

func (_c *SubscriptionCreate) SetNillableUpdatedAt(v *time.Time) *SubscriptionCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*SubscriptionCreate) SetPriceID

func (_c *SubscriptionCreate) SetPriceID(v string) *SubscriptionCreate

SetPriceID sets the "price_id" field.

func (*SubscriptionCreate) SetProvider

func (_c *SubscriptionCreate) SetProvider(v string) *SubscriptionCreate

SetProvider sets the "provider" field.

func (*SubscriptionCreate) SetProviderSubscriptionID

func (_c *SubscriptionCreate) SetProviderSubscriptionID(v string) *SubscriptionCreate

SetProviderSubscriptionID sets the "provider_subscription_id" field.

func (*SubscriptionCreate) SetStatus

SetStatus sets the "status" field.

func (*SubscriptionCreate) SetTrialEnd

func (_c *SubscriptionCreate) SetTrialEnd(v time.Time) *SubscriptionCreate

SetTrialEnd sets the "trial_end" field.

func (*SubscriptionCreate) SetTrialStart

func (_c *SubscriptionCreate) SetTrialStart(v time.Time) *SubscriptionCreate

SetTrialStart sets the "trial_start" field.

func (*SubscriptionCreate) SetUpdatedAt

func (_c *SubscriptionCreate) SetUpdatedAt(v time.Time) *SubscriptionCreate

SetUpdatedAt sets the "updated_at" field.

type SubscriptionCreateBulk

type SubscriptionCreateBulk struct {
	// contains filtered or unexported fields
}

SubscriptionCreateBulk is the builder for creating many Subscription entities in bulk.

func (*SubscriptionCreateBulk) Exec

Exec executes the query.

func (*SubscriptionCreateBulk) ExecX

func (_c *SubscriptionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SubscriptionCreateBulk) Save

Save creates the Subscription entities in the database.

func (*SubscriptionCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type SubscriptionDelete

type SubscriptionDelete struct {
	// contains filtered or unexported fields
}

SubscriptionDelete is the builder for deleting a Subscription entity.

func (*SubscriptionDelete) Exec

func (_d *SubscriptionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SubscriptionDelete) ExecX

func (_d *SubscriptionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SubscriptionDelete) Where

Where appends a list predicates to the SubscriptionDelete builder.

type SubscriptionDeleteOne

type SubscriptionDeleteOne struct {
	// contains filtered or unexported fields
}

SubscriptionDeleteOne is the builder for deleting a single Subscription entity.

func (*SubscriptionDeleteOne) Exec

Exec executes the deletion query.

func (*SubscriptionDeleteOne) ExecX

func (_d *SubscriptionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SubscriptionDeleteOne) Where

Where appends a list predicates to the SubscriptionDelete builder.

type SubscriptionEdges

type SubscriptionEdges struct {
	// Payment customer who owns this subscription
	Customer *PaymentCustomer `json:"customer,omitempty"`
	// contains filtered or unexported fields
}

SubscriptionEdges holds the relations/edges for other nodes in the graph.

func (SubscriptionEdges) CustomerOrErr

func (e SubscriptionEdges) CustomerOrErr() (*PaymentCustomer, error)

CustomerOrErr returns the Customer value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type SubscriptionGroupBy

type SubscriptionGroupBy struct {
	// contains filtered or unexported fields
}

SubscriptionGroupBy is the group-by builder for Subscription entities.

func (*SubscriptionGroupBy) Aggregate

func (_g *SubscriptionGroupBy) Aggregate(fns ...AggregateFunc) *SubscriptionGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*SubscriptionGroupBy) Bool

func (s *SubscriptionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SubscriptionGroupBy) BoolX

func (s *SubscriptionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SubscriptionGroupBy) Bools

func (s *SubscriptionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SubscriptionGroupBy) BoolsX

func (s *SubscriptionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SubscriptionGroupBy) Float64

func (s *SubscriptionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SubscriptionGroupBy) Float64X

func (s *SubscriptionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SubscriptionGroupBy) Float64s

func (s *SubscriptionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SubscriptionGroupBy) Float64sX

func (s *SubscriptionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SubscriptionGroupBy) Int

func (s *SubscriptionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SubscriptionGroupBy) IntX

func (s *SubscriptionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SubscriptionGroupBy) Ints

func (s *SubscriptionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SubscriptionGroupBy) IntsX

func (s *SubscriptionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SubscriptionGroupBy) Scan

func (_g *SubscriptionGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SubscriptionGroupBy) ScanX

func (s *SubscriptionGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SubscriptionGroupBy) String

func (s *SubscriptionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SubscriptionGroupBy) StringX

func (s *SubscriptionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SubscriptionGroupBy) Strings

func (s *SubscriptionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SubscriptionGroupBy) StringsX

func (s *SubscriptionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SubscriptionMutation

type SubscriptionMutation struct {
	// contains filtered or unexported fields
}

SubscriptionMutation represents an operation that mutates the Subscription nodes in the graph.

func (*SubscriptionMutation) AddAmount

func (m *SubscriptionMutation) AddAmount(i int64)

AddAmount adds i to the "amount" field.

func (*SubscriptionMutation) AddField

func (m *SubscriptionMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*SubscriptionMutation) AddIntervalCount

func (m *SubscriptionMutation) AddIntervalCount(i int)

AddIntervalCount adds i to the "interval_count" field.

func (*SubscriptionMutation) AddedAmount

func (m *SubscriptionMutation) AddedAmount() (r int64, exists bool)

AddedAmount returns the value that was added to the "amount" field in this mutation.

func (*SubscriptionMutation) AddedEdges

func (m *SubscriptionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SubscriptionMutation) AddedField

func (m *SubscriptionMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*SubscriptionMutation) AddedFields

func (m *SubscriptionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SubscriptionMutation) AddedIDs

func (m *SubscriptionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SubscriptionMutation) AddedIntervalCount

func (m *SubscriptionMutation) AddedIntervalCount() (r int, exists bool)

AddedIntervalCount returns the value that was added to the "interval_count" field in this mutation.

func (*SubscriptionMutation) Amount

func (m *SubscriptionMutation) Amount() (r int64, exists bool)

Amount returns the value of the "amount" field in the mutation.

func (*SubscriptionMutation) CanceledAt

func (m *SubscriptionMutation) CanceledAt() (r time.Time, exists bool)

CanceledAt returns the value of the "canceled_at" field in the mutation.

func (*SubscriptionMutation) CanceledAtCleared

func (m *SubscriptionMutation) CanceledAtCleared() bool

CanceledAtCleared returns if the "canceled_at" field was cleared in this mutation.

func (*SubscriptionMutation) ClearCanceledAt

func (m *SubscriptionMutation) ClearCanceledAt()

ClearCanceledAt clears the value of the "canceled_at" field.

func (*SubscriptionMutation) ClearCurrentPeriodEnd

func (m *SubscriptionMutation) ClearCurrentPeriodEnd()

ClearCurrentPeriodEnd clears the value of the "current_period_end" field.

func (*SubscriptionMutation) ClearCurrentPeriodStart

func (m *SubscriptionMutation) ClearCurrentPeriodStart()

ClearCurrentPeriodStart clears the value of the "current_period_start" field.

func (*SubscriptionMutation) ClearCustomer

func (m *SubscriptionMutation) ClearCustomer()

ClearCustomer clears the "customer" edge to the PaymentCustomer entity.

func (*SubscriptionMutation) ClearEdge

func (m *SubscriptionMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*SubscriptionMutation) ClearEndedAt

func (m *SubscriptionMutation) ClearEndedAt()

ClearEndedAt clears the value of the "ended_at" field.

func (*SubscriptionMutation) ClearField

func (m *SubscriptionMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*SubscriptionMutation) ClearMetadata

func (m *SubscriptionMutation) ClearMetadata()

ClearMetadata clears the value of the "metadata" field.

func (*SubscriptionMutation) ClearTrialEnd

func (m *SubscriptionMutation) ClearTrialEnd()

ClearTrialEnd clears the value of the "trial_end" field.

func (*SubscriptionMutation) ClearTrialStart

func (m *SubscriptionMutation) ClearTrialStart()

ClearTrialStart clears the value of the "trial_start" field.

func (*SubscriptionMutation) ClearedEdges

func (m *SubscriptionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SubscriptionMutation) ClearedFields

func (m *SubscriptionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SubscriptionMutation) Client

func (m SubscriptionMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*SubscriptionMutation) CreatedAt

func (m *SubscriptionMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*SubscriptionMutation) Currency

func (m *SubscriptionMutation) Currency() (r string, exists bool)

Currency returns the value of the "currency" field in the mutation.

func (*SubscriptionMutation) CurrentPeriodEnd

func (m *SubscriptionMutation) CurrentPeriodEnd() (r time.Time, exists bool)

CurrentPeriodEnd returns the value of the "current_period_end" field in the mutation.

func (*SubscriptionMutation) CurrentPeriodEndCleared

func (m *SubscriptionMutation) CurrentPeriodEndCleared() bool

CurrentPeriodEndCleared returns if the "current_period_end" field was cleared in this mutation.

func (*SubscriptionMutation) CurrentPeriodStart

func (m *SubscriptionMutation) CurrentPeriodStart() (r time.Time, exists bool)

CurrentPeriodStart returns the value of the "current_period_start" field in the mutation.

func (*SubscriptionMutation) CurrentPeriodStartCleared

func (m *SubscriptionMutation) CurrentPeriodStartCleared() bool

CurrentPeriodStartCleared returns if the "current_period_start" field was cleared in this mutation.

func (*SubscriptionMutation) CustomerCleared

func (m *SubscriptionMutation) CustomerCleared() bool

CustomerCleared reports if the "customer" edge to the PaymentCustomer entity was cleared.

func (*SubscriptionMutation) CustomerID

func (m *SubscriptionMutation) CustomerID() (id int, exists bool)

CustomerID returns the "customer" edge ID in the mutation.

func (*SubscriptionMutation) CustomerIDs

func (m *SubscriptionMutation) CustomerIDs() (ids []int)

CustomerIDs returns the "customer" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CustomerID instead. It exists only for internal usage by the builders.

func (*SubscriptionMutation) EdgeCleared

func (m *SubscriptionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SubscriptionMutation) EndedAt

func (m *SubscriptionMutation) EndedAt() (r time.Time, exists bool)

EndedAt returns the value of the "ended_at" field in the mutation.

func (*SubscriptionMutation) EndedAtCleared

func (m *SubscriptionMutation) EndedAtCleared() bool

EndedAtCleared returns if the "ended_at" field was cleared in this mutation.

func (*SubscriptionMutation) Field

func (m *SubscriptionMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*SubscriptionMutation) FieldCleared

func (m *SubscriptionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SubscriptionMutation) Fields

func (m *SubscriptionMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*SubscriptionMutation) ID

func (m *SubscriptionMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*SubscriptionMutation) IDs

func (m *SubscriptionMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*SubscriptionMutation) Interval

func (m *SubscriptionMutation) Interval() (r subscription.Interval, exists bool)

Interval returns the value of the "interval" field in the mutation.

func (*SubscriptionMutation) IntervalCount

func (m *SubscriptionMutation) IntervalCount() (r int, exists bool)

IntervalCount returns the value of the "interval_count" field in the mutation.

func (*SubscriptionMutation) Metadata

func (m *SubscriptionMutation) Metadata() (r map[string]interface{}, exists bool)

Metadata returns the value of the "metadata" field in the mutation.

func (*SubscriptionMutation) MetadataCleared

func (m *SubscriptionMutation) MetadataCleared() bool

MetadataCleared returns if the "metadata" field was cleared in this mutation.

func (*SubscriptionMutation) OldAmount

func (m *SubscriptionMutation) OldAmount(ctx context.Context) (v int64, err error)

OldAmount returns the old "amount" field's value of the Subscription entity. If the Subscription object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SubscriptionMutation) OldCanceledAt

func (m *SubscriptionMutation) OldCanceledAt(ctx context.Context) (v time.Time, err error)

OldCanceledAt returns the old "canceled_at" field's value of the Subscription entity. If the Subscription object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SubscriptionMutation) OldCreatedAt

func (m *SubscriptionMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Subscription entity. If the Subscription object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SubscriptionMutation) OldCurrency

func (m *SubscriptionMutation) OldCurrency(ctx context.Context) (v string, err error)

OldCurrency returns the old "currency" field's value of the Subscription entity. If the Subscription object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SubscriptionMutation) OldCurrentPeriodEnd

func (m *SubscriptionMutation) OldCurrentPeriodEnd(ctx context.Context) (v time.Time, err error)

OldCurrentPeriodEnd returns the old "current_period_end" field's value of the Subscription entity. If the Subscription object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SubscriptionMutation) OldCurrentPeriodStart

func (m *SubscriptionMutation) OldCurrentPeriodStart(ctx context.Context) (v time.Time, err error)

OldCurrentPeriodStart returns the old "current_period_start" field's value of the Subscription entity. If the Subscription object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SubscriptionMutation) OldEndedAt

func (m *SubscriptionMutation) OldEndedAt(ctx context.Context) (v time.Time, err error)

OldEndedAt returns the old "ended_at" field's value of the Subscription entity. If the Subscription object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SubscriptionMutation) OldField

func (m *SubscriptionMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*SubscriptionMutation) OldInterval

func (m *SubscriptionMutation) OldInterval(ctx context.Context) (v subscription.Interval, err error)

OldInterval returns the old "interval" field's value of the Subscription entity. If the Subscription object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SubscriptionMutation) OldIntervalCount

func (m *SubscriptionMutation) OldIntervalCount(ctx context.Context) (v int, err error)

OldIntervalCount returns the old "interval_count" field's value of the Subscription entity. If the Subscription object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SubscriptionMutation) OldMetadata

func (m *SubscriptionMutation) OldMetadata(ctx context.Context) (v map[string]interface{}, err error)

OldMetadata returns the old "metadata" field's value of the Subscription entity. If the Subscription object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SubscriptionMutation) OldPriceID

func (m *SubscriptionMutation) OldPriceID(ctx context.Context) (v string, err error)

OldPriceID returns the old "price_id" field's value of the Subscription entity. If the Subscription object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SubscriptionMutation) OldProvider

func (m *SubscriptionMutation) OldProvider(ctx context.Context) (v string, err error)

OldProvider returns the old "provider" field's value of the Subscription entity. If the Subscription object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SubscriptionMutation) OldProviderSubscriptionID

func (m *SubscriptionMutation) OldProviderSubscriptionID(ctx context.Context) (v string, err error)

OldProviderSubscriptionID returns the old "provider_subscription_id" field's value of the Subscription entity. If the Subscription object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SubscriptionMutation) OldStatus

func (m *SubscriptionMutation) OldStatus(ctx context.Context) (v subscription.Status, err error)

OldStatus returns the old "status" field's value of the Subscription entity. If the Subscription object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SubscriptionMutation) OldTrialEnd

func (m *SubscriptionMutation) OldTrialEnd(ctx context.Context) (v time.Time, err error)

OldTrialEnd returns the old "trial_end" field's value of the Subscription entity. If the Subscription object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SubscriptionMutation) OldTrialStart

func (m *SubscriptionMutation) OldTrialStart(ctx context.Context) (v time.Time, err error)

OldTrialStart returns the old "trial_start" field's value of the Subscription entity. If the Subscription object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SubscriptionMutation) OldUpdatedAt

func (m *SubscriptionMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Subscription entity. If the Subscription object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SubscriptionMutation) Op

func (m *SubscriptionMutation) Op() Op

Op returns the operation name.

func (*SubscriptionMutation) PriceID

func (m *SubscriptionMutation) PriceID() (r string, exists bool)

PriceID returns the value of the "price_id" field in the mutation.

func (*SubscriptionMutation) Provider

func (m *SubscriptionMutation) Provider() (r string, exists bool)

Provider returns the value of the "provider" field in the mutation.

func (*SubscriptionMutation) ProviderSubscriptionID

func (m *SubscriptionMutation) ProviderSubscriptionID() (r string, exists bool)

ProviderSubscriptionID returns the value of the "provider_subscription_id" field in the mutation.

func (*SubscriptionMutation) RemovedEdges

func (m *SubscriptionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SubscriptionMutation) RemovedIDs

func (m *SubscriptionMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*SubscriptionMutation) ResetAmount

func (m *SubscriptionMutation) ResetAmount()

ResetAmount resets all changes to the "amount" field.

func (*SubscriptionMutation) ResetCanceledAt

func (m *SubscriptionMutation) ResetCanceledAt()

ResetCanceledAt resets all changes to the "canceled_at" field.

func (*SubscriptionMutation) ResetCreatedAt

func (m *SubscriptionMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*SubscriptionMutation) ResetCurrency

func (m *SubscriptionMutation) ResetCurrency()

ResetCurrency resets all changes to the "currency" field.

func (*SubscriptionMutation) ResetCurrentPeriodEnd

func (m *SubscriptionMutation) ResetCurrentPeriodEnd()

ResetCurrentPeriodEnd resets all changes to the "current_period_end" field.

func (*SubscriptionMutation) ResetCurrentPeriodStart

func (m *SubscriptionMutation) ResetCurrentPeriodStart()

ResetCurrentPeriodStart resets all changes to the "current_period_start" field.

func (*SubscriptionMutation) ResetCustomer

func (m *SubscriptionMutation) ResetCustomer()

ResetCustomer resets all changes to the "customer" edge.

func (*SubscriptionMutation) ResetEdge

func (m *SubscriptionMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*SubscriptionMutation) ResetEndedAt

func (m *SubscriptionMutation) ResetEndedAt()

ResetEndedAt resets all changes to the "ended_at" field.

func (*SubscriptionMutation) ResetField

func (m *SubscriptionMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*SubscriptionMutation) ResetInterval

func (m *SubscriptionMutation) ResetInterval()

ResetInterval resets all changes to the "interval" field.

func (*SubscriptionMutation) ResetIntervalCount

func (m *SubscriptionMutation) ResetIntervalCount()

ResetIntervalCount resets all changes to the "interval_count" field.

func (*SubscriptionMutation) ResetMetadata

func (m *SubscriptionMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" field.

func (*SubscriptionMutation) ResetPriceID

func (m *SubscriptionMutation) ResetPriceID()

ResetPriceID resets all changes to the "price_id" field.

func (*SubscriptionMutation) ResetProvider

func (m *SubscriptionMutation) ResetProvider()

ResetProvider resets all changes to the "provider" field.

func (*SubscriptionMutation) ResetProviderSubscriptionID

func (m *SubscriptionMutation) ResetProviderSubscriptionID()

ResetProviderSubscriptionID resets all changes to the "provider_subscription_id" field.

func (*SubscriptionMutation) ResetStatus

func (m *SubscriptionMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*SubscriptionMutation) ResetTrialEnd

func (m *SubscriptionMutation) ResetTrialEnd()

ResetTrialEnd resets all changes to the "trial_end" field.

func (*SubscriptionMutation) ResetTrialStart

func (m *SubscriptionMutation) ResetTrialStart()

ResetTrialStart resets all changes to the "trial_start" field.

func (*SubscriptionMutation) ResetUpdatedAt

func (m *SubscriptionMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*SubscriptionMutation) SetAmount

func (m *SubscriptionMutation) SetAmount(i int64)

SetAmount sets the "amount" field.

func (*SubscriptionMutation) SetCanceledAt

func (m *SubscriptionMutation) SetCanceledAt(t time.Time)

SetCanceledAt sets the "canceled_at" field.

func (*SubscriptionMutation) SetCreatedAt

func (m *SubscriptionMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*SubscriptionMutation) SetCurrency

func (m *SubscriptionMutation) SetCurrency(s string)

SetCurrency sets the "currency" field.

func (*SubscriptionMutation) SetCurrentPeriodEnd

func (m *SubscriptionMutation) SetCurrentPeriodEnd(t time.Time)

SetCurrentPeriodEnd sets the "current_period_end" field.

func (*SubscriptionMutation) SetCurrentPeriodStart

func (m *SubscriptionMutation) SetCurrentPeriodStart(t time.Time)

SetCurrentPeriodStart sets the "current_period_start" field.

func (*SubscriptionMutation) SetCustomerID

func (m *SubscriptionMutation) SetCustomerID(id int)

SetCustomerID sets the "customer" edge to the PaymentCustomer entity by id.

func (*SubscriptionMutation) SetEndedAt

func (m *SubscriptionMutation) SetEndedAt(t time.Time)

SetEndedAt sets the "ended_at" field.

func (*SubscriptionMutation) SetField

func (m *SubscriptionMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*SubscriptionMutation) SetInterval

func (m *SubscriptionMutation) SetInterval(s subscription.Interval)

SetInterval sets the "interval" field.

func (*SubscriptionMutation) SetIntervalCount

func (m *SubscriptionMutation) SetIntervalCount(i int)

SetIntervalCount sets the "interval_count" field.

func (*SubscriptionMutation) SetMetadata

func (m *SubscriptionMutation) SetMetadata(value map[string]interface{})

SetMetadata sets the "metadata" field.

func (*SubscriptionMutation) SetOp

func (m *SubscriptionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SubscriptionMutation) SetPriceID

func (m *SubscriptionMutation) SetPriceID(s string)

SetPriceID sets the "price_id" field.

func (*SubscriptionMutation) SetProvider

func (m *SubscriptionMutation) SetProvider(s string)

SetProvider sets the "provider" field.

func (*SubscriptionMutation) SetProviderSubscriptionID

func (m *SubscriptionMutation) SetProviderSubscriptionID(s string)

SetProviderSubscriptionID sets the "provider_subscription_id" field.

func (*SubscriptionMutation) SetStatus

func (m *SubscriptionMutation) SetStatus(s subscription.Status)

SetStatus sets the "status" field.

func (*SubscriptionMutation) SetTrialEnd

func (m *SubscriptionMutation) SetTrialEnd(t time.Time)

SetTrialEnd sets the "trial_end" field.

func (*SubscriptionMutation) SetTrialStart

func (m *SubscriptionMutation) SetTrialStart(t time.Time)

SetTrialStart sets the "trial_start" field.

func (*SubscriptionMutation) SetUpdatedAt

func (m *SubscriptionMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*SubscriptionMutation) Status

func (m *SubscriptionMutation) Status() (r subscription.Status, exists bool)

Status returns the value of the "status" field in the mutation.

func (*SubscriptionMutation) TrialEnd

func (m *SubscriptionMutation) TrialEnd() (r time.Time, exists bool)

TrialEnd returns the value of the "trial_end" field in the mutation.

func (*SubscriptionMutation) TrialEndCleared

func (m *SubscriptionMutation) TrialEndCleared() bool

TrialEndCleared returns if the "trial_end" field was cleared in this mutation.

func (*SubscriptionMutation) TrialStart

func (m *SubscriptionMutation) TrialStart() (r time.Time, exists bool)

TrialStart returns the value of the "trial_start" field in the mutation.

func (*SubscriptionMutation) TrialStartCleared

func (m *SubscriptionMutation) TrialStartCleared() bool

TrialStartCleared returns if the "trial_start" field was cleared in this mutation.

func (SubscriptionMutation) Tx

func (m SubscriptionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SubscriptionMutation) Type

func (m *SubscriptionMutation) Type() string

Type returns the node type of this mutation (Subscription).

func (*SubscriptionMutation) UpdatedAt

func (m *SubscriptionMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*SubscriptionMutation) Where

Where appends a list predicates to the SubscriptionMutation builder.

func (*SubscriptionMutation) WhereP

func (m *SubscriptionMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SubscriptionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type SubscriptionQuery

type SubscriptionQuery struct {
	// contains filtered or unexported fields
}

SubscriptionQuery is the builder for querying Subscription entities.

func (*SubscriptionQuery) Aggregate

func (_q *SubscriptionQuery) Aggregate(fns ...AggregateFunc) *SubscriptionSelect

Aggregate returns a SubscriptionSelect configured with the given aggregations.

func (*SubscriptionQuery) All

func (_q *SubscriptionQuery) All(ctx context.Context) ([]*Subscription, error)

All executes the query and returns a list of Subscriptions.

func (*SubscriptionQuery) AllX

func (_q *SubscriptionQuery) AllX(ctx context.Context) []*Subscription

AllX is like All, but panics if an error occurs.

func (*SubscriptionQuery) Clone

func (_q *SubscriptionQuery) Clone() *SubscriptionQuery

Clone returns a duplicate of the SubscriptionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SubscriptionQuery) Count

func (_q *SubscriptionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SubscriptionQuery) CountX

func (_q *SubscriptionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SubscriptionQuery) Exist

func (_q *SubscriptionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SubscriptionQuery) ExistX

func (_q *SubscriptionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SubscriptionQuery) First

func (_q *SubscriptionQuery) First(ctx context.Context) (*Subscription, error)

First returns the first Subscription entity from the query. Returns a *NotFoundError when no Subscription was found.

func (*SubscriptionQuery) FirstID

func (_q *SubscriptionQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Subscription ID from the query. Returns a *NotFoundError when no Subscription ID was found.

func (*SubscriptionQuery) FirstIDX

func (_q *SubscriptionQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*SubscriptionQuery) FirstX

func (_q *SubscriptionQuery) FirstX(ctx context.Context) *Subscription

FirstX is like First, but panics if an error occurs.

func (*SubscriptionQuery) GroupBy

func (_q *SubscriptionQuery) GroupBy(field string, fields ...string) *SubscriptionGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	ProviderSubscriptionID string `json:"provider_subscription_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Subscription.Query().
	GroupBy(subscription.FieldProviderSubscriptionID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SubscriptionQuery) IDs

func (_q *SubscriptionQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Subscription IDs.

func (*SubscriptionQuery) IDsX

func (_q *SubscriptionQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*SubscriptionQuery) Limit

func (_q *SubscriptionQuery) Limit(limit int) *SubscriptionQuery

Limit the number of records to be returned by this query.

func (*SubscriptionQuery) Offset

func (_q *SubscriptionQuery) Offset(offset int) *SubscriptionQuery

Offset to start from.

func (*SubscriptionQuery) Only

Only returns a single Subscription entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Subscription entity is found. Returns a *NotFoundError when no Subscription entities are found.

func (*SubscriptionQuery) OnlyID

func (_q *SubscriptionQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Subscription ID in the query. Returns a *NotSingularError when more than one Subscription ID is found. Returns a *NotFoundError when no entities are found.

func (*SubscriptionQuery) OnlyIDX

func (_q *SubscriptionQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SubscriptionQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*SubscriptionQuery) Order

Order specifies how the records should be ordered.

func (*SubscriptionQuery) QueryCustomer

func (_q *SubscriptionQuery) QueryCustomer() *PaymentCustomerQuery

QueryCustomer chains the current query on the "customer" edge.

func (*SubscriptionQuery) Select

func (_q *SubscriptionQuery) Select(fields ...string) *SubscriptionSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	ProviderSubscriptionID string `json:"provider_subscription_id,omitempty"`
}

client.Subscription.Query().
	Select(subscription.FieldProviderSubscriptionID).
	Scan(ctx, &v)

func (*SubscriptionQuery) Unique

func (_q *SubscriptionQuery) Unique(unique bool) *SubscriptionQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*SubscriptionQuery) Where

Where adds a new predicate for the SubscriptionQuery builder.

func (*SubscriptionQuery) WithCustomer

func (_q *SubscriptionQuery) WithCustomer(opts ...func(*PaymentCustomerQuery)) *SubscriptionQuery

WithCustomer tells the query-builder to eager-load the nodes that are connected to the "customer" edge. The optional arguments are used to configure the query builder of the edge.

type SubscriptionSelect

type SubscriptionSelect struct {
	*SubscriptionQuery
	// contains filtered or unexported fields
}

SubscriptionSelect is the builder for selecting fields of Subscription entities.

func (*SubscriptionSelect) Aggregate

func (_s *SubscriptionSelect) Aggregate(fns ...AggregateFunc) *SubscriptionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SubscriptionSelect) Bool

func (s *SubscriptionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SubscriptionSelect) BoolX

func (s *SubscriptionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SubscriptionSelect) Bools

func (s *SubscriptionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SubscriptionSelect) BoolsX

func (s *SubscriptionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SubscriptionSelect) Float64

func (s *SubscriptionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SubscriptionSelect) Float64X

func (s *SubscriptionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SubscriptionSelect) Float64s

func (s *SubscriptionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SubscriptionSelect) Float64sX

func (s *SubscriptionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SubscriptionSelect) Int

func (s *SubscriptionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SubscriptionSelect) IntX

func (s *SubscriptionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SubscriptionSelect) Ints

func (s *SubscriptionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SubscriptionSelect) IntsX

func (s *SubscriptionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SubscriptionSelect) Scan

func (_s *SubscriptionSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SubscriptionSelect) ScanX

func (s *SubscriptionSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SubscriptionSelect) String

func (s *SubscriptionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SubscriptionSelect) StringX

func (s *SubscriptionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SubscriptionSelect) Strings

func (s *SubscriptionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SubscriptionSelect) StringsX

func (s *SubscriptionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SubscriptionUpdate

type SubscriptionUpdate struct {
	// contains filtered or unexported fields
}

SubscriptionUpdate is the builder for updating Subscription entities.

func (*SubscriptionUpdate) AddAmount

func (_u *SubscriptionUpdate) AddAmount(v int64) *SubscriptionUpdate

AddAmount adds value to the "amount" field.

func (*SubscriptionUpdate) AddIntervalCount

func (_u *SubscriptionUpdate) AddIntervalCount(v int) *SubscriptionUpdate

AddIntervalCount adds value to the "interval_count" field.

func (*SubscriptionUpdate) ClearCanceledAt

func (_u *SubscriptionUpdate) ClearCanceledAt() *SubscriptionUpdate

ClearCanceledAt clears the value of the "canceled_at" field.

func (*SubscriptionUpdate) ClearCurrentPeriodEnd

func (_u *SubscriptionUpdate) ClearCurrentPeriodEnd() *SubscriptionUpdate

ClearCurrentPeriodEnd clears the value of the "current_period_end" field.

func (*SubscriptionUpdate) ClearCurrentPeriodStart

func (_u *SubscriptionUpdate) ClearCurrentPeriodStart() *SubscriptionUpdate

ClearCurrentPeriodStart clears the value of the "current_period_start" field.

func (*SubscriptionUpdate) ClearCustomer

func (_u *SubscriptionUpdate) ClearCustomer() *SubscriptionUpdate

ClearCustomer clears the "customer" edge to the PaymentCustomer entity.

func (*SubscriptionUpdate) ClearEndedAt

func (_u *SubscriptionUpdate) ClearEndedAt() *SubscriptionUpdate

ClearEndedAt clears the value of the "ended_at" field.

func (*SubscriptionUpdate) ClearMetadata

func (_u *SubscriptionUpdate) ClearMetadata() *SubscriptionUpdate

ClearMetadata clears the value of the "metadata" field.

func (*SubscriptionUpdate) ClearTrialEnd

func (_u *SubscriptionUpdate) ClearTrialEnd() *SubscriptionUpdate

ClearTrialEnd clears the value of the "trial_end" field.

func (*SubscriptionUpdate) ClearTrialStart

func (_u *SubscriptionUpdate) ClearTrialStart() *SubscriptionUpdate

ClearTrialStart clears the value of the "trial_start" field.

func (*SubscriptionUpdate) Exec

func (_u *SubscriptionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SubscriptionUpdate) ExecX

func (_u *SubscriptionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SubscriptionUpdate) Mutation

func (_u *SubscriptionUpdate) Mutation() *SubscriptionMutation

Mutation returns the SubscriptionMutation object of the builder.

func (*SubscriptionUpdate) Save

func (_u *SubscriptionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SubscriptionUpdate) SaveX

func (_u *SubscriptionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SubscriptionUpdate) SetAmount

func (_u *SubscriptionUpdate) SetAmount(v int64) *SubscriptionUpdate

SetAmount sets the "amount" field.

func (*SubscriptionUpdate) SetCanceledAt

func (_u *SubscriptionUpdate) SetCanceledAt(v time.Time) *SubscriptionUpdate

SetCanceledAt sets the "canceled_at" field.

func (*SubscriptionUpdate) SetCurrency

func (_u *SubscriptionUpdate) SetCurrency(v string) *SubscriptionUpdate

SetCurrency sets the "currency" field.

func (*SubscriptionUpdate) SetCurrentPeriodEnd

func (_u *SubscriptionUpdate) SetCurrentPeriodEnd(v time.Time) *SubscriptionUpdate

SetCurrentPeriodEnd sets the "current_period_end" field.

func (*SubscriptionUpdate) SetCurrentPeriodStart

func (_u *SubscriptionUpdate) SetCurrentPeriodStart(v time.Time) *SubscriptionUpdate

SetCurrentPeriodStart sets the "current_period_start" field.

func (*SubscriptionUpdate) SetCustomer

SetCustomer sets the "customer" edge to the PaymentCustomer entity.

func (*SubscriptionUpdate) SetCustomerID

func (_u *SubscriptionUpdate) SetCustomerID(id int) *SubscriptionUpdate

SetCustomerID sets the "customer" edge to the PaymentCustomer entity by ID.

func (*SubscriptionUpdate) SetEndedAt

func (_u *SubscriptionUpdate) SetEndedAt(v time.Time) *SubscriptionUpdate

SetEndedAt sets the "ended_at" field.

func (*SubscriptionUpdate) SetInterval

SetInterval sets the "interval" field.

func (*SubscriptionUpdate) SetIntervalCount

func (_u *SubscriptionUpdate) SetIntervalCount(v int) *SubscriptionUpdate

SetIntervalCount sets the "interval_count" field.

func (*SubscriptionUpdate) SetMetadata

func (_u *SubscriptionUpdate) SetMetadata(v map[string]interface{}) *SubscriptionUpdate

SetMetadata sets the "metadata" field.

func (*SubscriptionUpdate) SetNillableAmount

func (_u *SubscriptionUpdate) SetNillableAmount(v *int64) *SubscriptionUpdate

SetNillableAmount sets the "amount" field if the given value is not nil.

func (*SubscriptionUpdate) SetNillableCanceledAt

func (_u *SubscriptionUpdate) SetNillableCanceledAt(v *time.Time) *SubscriptionUpdate

SetNillableCanceledAt sets the "canceled_at" field if the given value is not nil.

func (*SubscriptionUpdate) SetNillableCurrency

func (_u *SubscriptionUpdate) SetNillableCurrency(v *string) *SubscriptionUpdate

SetNillableCurrency sets the "currency" field if the given value is not nil.

func (*SubscriptionUpdate) SetNillableCurrentPeriodEnd

func (_u *SubscriptionUpdate) SetNillableCurrentPeriodEnd(v *time.Time) *SubscriptionUpdate

SetNillableCurrentPeriodEnd sets the "current_period_end" field if the given value is not nil.

func (*SubscriptionUpdate) SetNillableCurrentPeriodStart

func (_u *SubscriptionUpdate) SetNillableCurrentPeriodStart(v *time.Time) *SubscriptionUpdate

SetNillableCurrentPeriodStart sets the "current_period_start" field if the given value is not nil.

func (*SubscriptionUpdate) SetNillableEndedAt

func (_u *SubscriptionUpdate) SetNillableEndedAt(v *time.Time) *SubscriptionUpdate

SetNillableEndedAt sets the "ended_at" field if the given value is not nil.

func (*SubscriptionUpdate) SetNillableInterval

func (_u *SubscriptionUpdate) SetNillableInterval(v *subscription.Interval) *SubscriptionUpdate

SetNillableInterval sets the "interval" field if the given value is not nil.

func (*SubscriptionUpdate) SetNillableIntervalCount

func (_u *SubscriptionUpdate) SetNillableIntervalCount(v *int) *SubscriptionUpdate

SetNillableIntervalCount sets the "interval_count" field if the given value is not nil.

func (*SubscriptionUpdate) SetNillablePriceID

func (_u *SubscriptionUpdate) SetNillablePriceID(v *string) *SubscriptionUpdate

SetNillablePriceID sets the "price_id" field if the given value is not nil.

func (*SubscriptionUpdate) SetNillableProvider

func (_u *SubscriptionUpdate) SetNillableProvider(v *string) *SubscriptionUpdate

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*SubscriptionUpdate) SetNillableProviderSubscriptionID

func (_u *SubscriptionUpdate) SetNillableProviderSubscriptionID(v *string) *SubscriptionUpdate

SetNillableProviderSubscriptionID sets the "provider_subscription_id" field if the given value is not nil.

func (*SubscriptionUpdate) SetNillableStatus

func (_u *SubscriptionUpdate) SetNillableStatus(v *subscription.Status) *SubscriptionUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*SubscriptionUpdate) SetNillableTrialEnd

func (_u *SubscriptionUpdate) SetNillableTrialEnd(v *time.Time) *SubscriptionUpdate

SetNillableTrialEnd sets the "trial_end" field if the given value is not nil.

func (*SubscriptionUpdate) SetNillableTrialStart

func (_u *SubscriptionUpdate) SetNillableTrialStart(v *time.Time) *SubscriptionUpdate

SetNillableTrialStart sets the "trial_start" field if the given value is not nil.

func (*SubscriptionUpdate) SetPriceID

func (_u *SubscriptionUpdate) SetPriceID(v string) *SubscriptionUpdate

SetPriceID sets the "price_id" field.

func (*SubscriptionUpdate) SetProvider

func (_u *SubscriptionUpdate) SetProvider(v string) *SubscriptionUpdate

SetProvider sets the "provider" field.

func (*SubscriptionUpdate) SetProviderSubscriptionID

func (_u *SubscriptionUpdate) SetProviderSubscriptionID(v string) *SubscriptionUpdate

SetProviderSubscriptionID sets the "provider_subscription_id" field.

func (*SubscriptionUpdate) SetStatus

SetStatus sets the "status" field.

func (*SubscriptionUpdate) SetTrialEnd

func (_u *SubscriptionUpdate) SetTrialEnd(v time.Time) *SubscriptionUpdate

SetTrialEnd sets the "trial_end" field.

func (*SubscriptionUpdate) SetTrialStart

func (_u *SubscriptionUpdate) SetTrialStart(v time.Time) *SubscriptionUpdate

SetTrialStart sets the "trial_start" field.

func (*SubscriptionUpdate) SetUpdatedAt

func (_u *SubscriptionUpdate) SetUpdatedAt(v time.Time) *SubscriptionUpdate

SetUpdatedAt sets the "updated_at" field.

func (*SubscriptionUpdate) Where

Where appends a list predicates to the SubscriptionUpdate builder.

type SubscriptionUpdateOne

type SubscriptionUpdateOne struct {
	// contains filtered or unexported fields
}

SubscriptionUpdateOne is the builder for updating a single Subscription entity.

func (*SubscriptionUpdateOne) AddAmount

AddAmount adds value to the "amount" field.

func (*SubscriptionUpdateOne) AddIntervalCount

func (_u *SubscriptionUpdateOne) AddIntervalCount(v int) *SubscriptionUpdateOne

AddIntervalCount adds value to the "interval_count" field.

func (*SubscriptionUpdateOne) ClearCanceledAt

func (_u *SubscriptionUpdateOne) ClearCanceledAt() *SubscriptionUpdateOne

ClearCanceledAt clears the value of the "canceled_at" field.

func (*SubscriptionUpdateOne) ClearCurrentPeriodEnd

func (_u *SubscriptionUpdateOne) ClearCurrentPeriodEnd() *SubscriptionUpdateOne

ClearCurrentPeriodEnd clears the value of the "current_period_end" field.

func (*SubscriptionUpdateOne) ClearCurrentPeriodStart

func (_u *SubscriptionUpdateOne) ClearCurrentPeriodStart() *SubscriptionUpdateOne

ClearCurrentPeriodStart clears the value of the "current_period_start" field.

func (*SubscriptionUpdateOne) ClearCustomer

func (_u *SubscriptionUpdateOne) ClearCustomer() *SubscriptionUpdateOne

ClearCustomer clears the "customer" edge to the PaymentCustomer entity.

func (*SubscriptionUpdateOne) ClearEndedAt

func (_u *SubscriptionUpdateOne) ClearEndedAt() *SubscriptionUpdateOne

ClearEndedAt clears the value of the "ended_at" field.

func (*SubscriptionUpdateOne) ClearMetadata

func (_u *SubscriptionUpdateOne) ClearMetadata() *SubscriptionUpdateOne

ClearMetadata clears the value of the "metadata" field.

func (*SubscriptionUpdateOne) ClearTrialEnd

func (_u *SubscriptionUpdateOne) ClearTrialEnd() *SubscriptionUpdateOne

ClearTrialEnd clears the value of the "trial_end" field.

func (*SubscriptionUpdateOne) ClearTrialStart

func (_u *SubscriptionUpdateOne) ClearTrialStart() *SubscriptionUpdateOne

ClearTrialStart clears the value of the "trial_start" field.

func (*SubscriptionUpdateOne) Exec

Exec executes the query on the entity.

func (*SubscriptionUpdateOne) ExecX

func (_u *SubscriptionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SubscriptionUpdateOne) Mutation

Mutation returns the SubscriptionMutation object of the builder.

func (*SubscriptionUpdateOne) Save

Save executes the query and returns the updated Subscription entity.

func (*SubscriptionUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*SubscriptionUpdateOne) Select

func (_u *SubscriptionUpdateOne) Select(field string, fields ...string) *SubscriptionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SubscriptionUpdateOne) SetAmount

SetAmount sets the "amount" field.

func (*SubscriptionUpdateOne) SetCanceledAt

func (_u *SubscriptionUpdateOne) SetCanceledAt(v time.Time) *SubscriptionUpdateOne

SetCanceledAt sets the "canceled_at" field.

func (*SubscriptionUpdateOne) SetCurrency

SetCurrency sets the "currency" field.

func (*SubscriptionUpdateOne) SetCurrentPeriodEnd

func (_u *SubscriptionUpdateOne) SetCurrentPeriodEnd(v time.Time) *SubscriptionUpdateOne

SetCurrentPeriodEnd sets the "current_period_end" field.

func (*SubscriptionUpdateOne) SetCurrentPeriodStart

func (_u *SubscriptionUpdateOne) SetCurrentPeriodStart(v time.Time) *SubscriptionUpdateOne

SetCurrentPeriodStart sets the "current_period_start" field.

func (*SubscriptionUpdateOne) SetCustomer

SetCustomer sets the "customer" edge to the PaymentCustomer entity.

func (*SubscriptionUpdateOne) SetCustomerID

func (_u *SubscriptionUpdateOne) SetCustomerID(id int) *SubscriptionUpdateOne

SetCustomerID sets the "customer" edge to the PaymentCustomer entity by ID.

func (*SubscriptionUpdateOne) SetEndedAt

SetEndedAt sets the "ended_at" field.

func (*SubscriptionUpdateOne) SetInterval

SetInterval sets the "interval" field.

func (*SubscriptionUpdateOne) SetIntervalCount

func (_u *SubscriptionUpdateOne) SetIntervalCount(v int) *SubscriptionUpdateOne

SetIntervalCount sets the "interval_count" field.

func (*SubscriptionUpdateOne) SetMetadata

func (_u *SubscriptionUpdateOne) SetMetadata(v map[string]interface{}) *SubscriptionUpdateOne

SetMetadata sets the "metadata" field.

func (*SubscriptionUpdateOne) SetNillableAmount

func (_u *SubscriptionUpdateOne) SetNillableAmount(v *int64) *SubscriptionUpdateOne

SetNillableAmount sets the "amount" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetNillableCanceledAt

func (_u *SubscriptionUpdateOne) SetNillableCanceledAt(v *time.Time) *SubscriptionUpdateOne

SetNillableCanceledAt sets the "canceled_at" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetNillableCurrency

func (_u *SubscriptionUpdateOne) SetNillableCurrency(v *string) *SubscriptionUpdateOne

SetNillableCurrency sets the "currency" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetNillableCurrentPeriodEnd

func (_u *SubscriptionUpdateOne) SetNillableCurrentPeriodEnd(v *time.Time) *SubscriptionUpdateOne

SetNillableCurrentPeriodEnd sets the "current_period_end" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetNillableCurrentPeriodStart

func (_u *SubscriptionUpdateOne) SetNillableCurrentPeriodStart(v *time.Time) *SubscriptionUpdateOne

SetNillableCurrentPeriodStart sets the "current_period_start" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetNillableEndedAt

func (_u *SubscriptionUpdateOne) SetNillableEndedAt(v *time.Time) *SubscriptionUpdateOne

SetNillableEndedAt sets the "ended_at" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetNillableInterval

SetNillableInterval sets the "interval" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetNillableIntervalCount

func (_u *SubscriptionUpdateOne) SetNillableIntervalCount(v *int) *SubscriptionUpdateOne

SetNillableIntervalCount sets the "interval_count" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetNillablePriceID

func (_u *SubscriptionUpdateOne) SetNillablePriceID(v *string) *SubscriptionUpdateOne

SetNillablePriceID sets the "price_id" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetNillableProvider

func (_u *SubscriptionUpdateOne) SetNillableProvider(v *string) *SubscriptionUpdateOne

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetNillableProviderSubscriptionID

func (_u *SubscriptionUpdateOne) SetNillableProviderSubscriptionID(v *string) *SubscriptionUpdateOne

SetNillableProviderSubscriptionID sets the "provider_subscription_id" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetNillableStatus

SetNillableStatus sets the "status" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetNillableTrialEnd

func (_u *SubscriptionUpdateOne) SetNillableTrialEnd(v *time.Time) *SubscriptionUpdateOne

SetNillableTrialEnd sets the "trial_end" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetNillableTrialStart

func (_u *SubscriptionUpdateOne) SetNillableTrialStart(v *time.Time) *SubscriptionUpdateOne

SetNillableTrialStart sets the "trial_start" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetPriceID

SetPriceID sets the "price_id" field.

func (*SubscriptionUpdateOne) SetProvider

SetProvider sets the "provider" field.

func (*SubscriptionUpdateOne) SetProviderSubscriptionID

func (_u *SubscriptionUpdateOne) SetProviderSubscriptionID(v string) *SubscriptionUpdateOne

SetProviderSubscriptionID sets the "provider_subscription_id" field.

func (*SubscriptionUpdateOne) SetStatus

SetStatus sets the "status" field.

func (*SubscriptionUpdateOne) SetTrialEnd

SetTrialEnd sets the "trial_end" field.

func (*SubscriptionUpdateOne) SetTrialStart

func (_u *SubscriptionUpdateOne) SetTrialStart(v time.Time) *SubscriptionUpdateOne

SetTrialStart sets the "trial_start" field.

func (*SubscriptionUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*SubscriptionUpdateOne) Where

Where appends a list predicates to the SubscriptionUpdate builder.

type Subscriptions

type Subscriptions []*Subscription

Subscriptions is a parsable slice of Subscription.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// ChatBan is the client for interacting with the ChatBan builders.
	ChatBan *ChatBanClient
	// ChatMessage is the client for interacting with the ChatMessage builders.
	ChatMessage *ChatMessageClient
	// ChatRoom is the client for interacting with the ChatRoom builders.
	ChatRoom *ChatRoomClient
	// PasswordToken is the client for interacting with the PasswordToken builders.
	PasswordToken *PasswordTokenClient
	// PaymentCustomer is the client for interacting with the PaymentCustomer builders.
	PaymentCustomer *PaymentCustomerClient
	// PaymentIntent is the client for interacting with the PaymentIntent builders.
	PaymentIntent *PaymentIntentClient
	// PaymentMethod is the client for interacting with the PaymentMethod builders.
	PaymentMethod *PaymentMethodClient
	// Subscription is the client for interacting with the Subscription builders.
	Subscription *SubscriptionClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"-"`
	// Verified holds the value of the "verified" field.
	Verified bool `json:"verified,omitempty"`
	// Admin holds the value of the "admin" field.
	Admin bool `json:"admin,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserQuery when eager-loading is set.
	Edges UserEdges `json:"edges"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) QueryChatBans

func (_m *User) QueryChatBans() *ChatBanQuery

QueryChatBans queries the "chat_bans" edge of the User entity.

func (*User) QueryChatBansIssued

func (_m *User) QueryChatBansIssued() *ChatBanQuery

QueryChatBansIssued queries the "chat_bans_issued" edge of the User entity.

func (*User) QueryChatMessages

func (_m *User) QueryChatMessages() *ChatMessageQuery

QueryChatMessages queries the "chat_messages" edge of the User entity.

func (*User) QueryOwnedChatRooms

func (_m *User) QueryOwnedChatRooms() *ChatRoomQuery

QueryOwnedChatRooms queries the "owned_chat_rooms" edge of the User entity.

func (*User) QueryOwner

func (_m *User) QueryOwner() *PasswordTokenQuery

QueryOwner queries the "owner" edge of the User entity.

func (*User) QueryPaymentCustomer

func (_m *User) QueryPaymentCustomer() *PaymentCustomerQuery

QueryPaymentCustomer queries the "payment_customer" edge of the User entity.

func (*User) String

func (_m *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (_m *User) Unwrap() *User

Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*User) Update

func (_m *User) Update() *UserUpdateOne

Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.

func (*User) Value

func (_m *User) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the User. This includes values selected through modifiers, order, etc.

type UserClient

type UserClient struct {
	// contains filtered or unexported fields
}

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

CreateBulk returns a builder for creating a bulk of User entities.

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(_m *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id int) *UserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id int) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id int) *User

GetX is like Get, but panics if an error occurs.

func (*UserClient) Hooks

func (c *UserClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserClient) Intercept

func (c *UserClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.

func (*UserClient) Interceptors

func (c *UserClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserClient) MapCreateBulk

func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryChatBans

func (c *UserClient) QueryChatBans(_m *User) *ChatBanQuery

QueryChatBans queries the chat_bans edge of a User.

func (*UserClient) QueryChatBansIssued

func (c *UserClient) QueryChatBansIssued(_m *User) *ChatBanQuery

QueryChatBansIssued queries the chat_bans_issued edge of a User.

func (*UserClient) QueryChatMessages

func (c *UserClient) QueryChatMessages(_m *User) *ChatMessageQuery

QueryChatMessages queries the chat_messages edge of a User.

func (*UserClient) QueryOwnedChatRooms

func (c *UserClient) QueryOwnedChatRooms(_m *User) *ChatRoomQuery

QueryOwnedChatRooms queries the owned_chat_rooms edge of a User.

func (*UserClient) QueryOwner

func (c *UserClient) QueryOwner(_m *User) *PasswordTokenQuery

QueryOwner queries the owner edge of a User.

func (*UserClient) QueryPaymentCustomer

func (c *UserClient) QueryPaymentCustomer(_m *User) *PaymentCustomerQuery

QueryPaymentCustomer queries the payment_customer edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(_m *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id int) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

func (c *UserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.

type UserCreate

type UserCreate struct {
	// contains filtered or unexported fields
}

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddChatBanIDs

func (_c *UserCreate) AddChatBanIDs(ids ...int) *UserCreate

AddChatBanIDs adds the "chat_bans" edge to the ChatBan entity by IDs.

func (*UserCreate) AddChatBans

func (_c *UserCreate) AddChatBans(v ...*ChatBan) *UserCreate

AddChatBans adds the "chat_bans" edges to the ChatBan entity.

func (*UserCreate) AddChatBansIssued

func (_c *UserCreate) AddChatBansIssued(v ...*ChatBan) *UserCreate

AddChatBansIssued adds the "chat_bans_issued" edges to the ChatBan entity.

func (*UserCreate) AddChatBansIssuedIDs

func (_c *UserCreate) AddChatBansIssuedIDs(ids ...int) *UserCreate

AddChatBansIssuedIDs adds the "chat_bans_issued" edge to the ChatBan entity by IDs.

func (*UserCreate) AddChatMessageIDs

func (_c *UserCreate) AddChatMessageIDs(ids ...int) *UserCreate

AddChatMessageIDs adds the "chat_messages" edge to the ChatMessage entity by IDs.

func (*UserCreate) AddChatMessages

func (_c *UserCreate) AddChatMessages(v ...*ChatMessage) *UserCreate

AddChatMessages adds the "chat_messages" edges to the ChatMessage entity.

func (*UserCreate) AddOwnedChatRoomIDs

func (_c *UserCreate) AddOwnedChatRoomIDs(ids ...int) *UserCreate

AddOwnedChatRoomIDs adds the "owned_chat_rooms" edge to the ChatRoom entity by IDs.

func (*UserCreate) AddOwnedChatRooms

func (_c *UserCreate) AddOwnedChatRooms(v ...*ChatRoom) *UserCreate

AddOwnedChatRooms adds the "owned_chat_rooms" edges to the ChatRoom entity.

func (*UserCreate) AddOwner

func (_c *UserCreate) AddOwner(v ...*PasswordToken) *UserCreate

AddOwner adds the "owner" edges to the PasswordToken entity.

func (*UserCreate) AddOwnerIDs

func (_c *UserCreate) AddOwnerIDs(ids ...int) *UserCreate

AddOwnerIDs adds the "owner" edge to the PasswordToken entity by IDs.

func (*UserCreate) Exec

func (_c *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX

func (_c *UserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreate) Mutation

func (_c *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

func (_c *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (_c *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetAdmin

func (_c *UserCreate) SetAdmin(v bool) *UserCreate

SetAdmin sets the "admin" field.

func (*UserCreate) SetCreatedAt

func (_c *UserCreate) SetCreatedAt(v time.Time) *UserCreate

SetCreatedAt sets the "created_at" field.

func (*UserCreate) SetEmail

func (_c *UserCreate) SetEmail(v string) *UserCreate

SetEmail sets the "email" field.

func (*UserCreate) SetName

func (_c *UserCreate) SetName(v string) *UserCreate

SetName sets the "name" field.

func (*UserCreate) SetNillableAdmin

func (_c *UserCreate) SetNillableAdmin(v *bool) *UserCreate

SetNillableAdmin sets the "admin" field if the given value is not nil.

func (*UserCreate) SetNillableCreatedAt

func (_c *UserCreate) SetNillableCreatedAt(v *time.Time) *UserCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserCreate) SetNillablePaymentCustomerID

func (_c *UserCreate) SetNillablePaymentCustomerID(id *int) *UserCreate

SetNillablePaymentCustomerID sets the "payment_customer" edge to the PaymentCustomer entity by ID if the given value is not nil.

func (*UserCreate) SetNillableVerified

func (_c *UserCreate) SetNillableVerified(v *bool) *UserCreate

SetNillableVerified sets the "verified" field if the given value is not nil.

func (*UserCreate) SetPassword

func (_c *UserCreate) SetPassword(v string) *UserCreate

SetPassword sets the "password" field.

func (*UserCreate) SetPaymentCustomer

func (_c *UserCreate) SetPaymentCustomer(v *PaymentCustomer) *UserCreate

SetPaymentCustomer sets the "payment_customer" edge to the PaymentCustomer entity.

func (*UserCreate) SetPaymentCustomerID

func (_c *UserCreate) SetPaymentCustomerID(id int) *UserCreate

SetPaymentCustomerID sets the "payment_customer" edge to the PaymentCustomer entity by ID.

func (*UserCreate) SetVerified

func (_c *UserCreate) SetVerified(v bool) *UserCreate

SetVerified sets the "verified" field.

type UserCreateBulk

type UserCreateBulk struct {
	// contains filtered or unexported fields
}

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (_c *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (_c *UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreateBulk) Save

func (_c *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (_c *UserCreateBulk) SaveX(ctx context.Context) []*User

SaveX is like Save, but panics if an error occurs.

type UserDelete

type UserDelete struct {
	// contains filtered or unexported fields
}

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (_d *UserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserDelete) ExecX

func (_d *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDelete) Where

func (_d *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

type UserDeleteOne struct {
	// contains filtered or unexported fields
}

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (_d *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (_d *UserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserDeleteOne) Where

func (_d *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

type UserEdges

type UserEdges struct {
	// Owner holds the value of the owner edge.
	Owner []*PasswordToken `json:"owner,omitempty"`
	// PaymentCustomer holds the value of the payment_customer edge.
	PaymentCustomer *PaymentCustomer `json:"payment_customer,omitempty"`
	// OwnedChatRooms holds the value of the owned_chat_rooms edge.
	OwnedChatRooms []*ChatRoom `json:"owned_chat_rooms,omitempty"`
	// ChatMessages holds the value of the chat_messages edge.
	ChatMessages []*ChatMessage `json:"chat_messages,omitempty"`
	// ChatBans holds the value of the chat_bans edge.
	ChatBans []*ChatBan `json:"chat_bans,omitempty"`
	// ChatBansIssued holds the value of the chat_bans_issued edge.
	ChatBansIssued []*ChatBan `json:"chat_bans_issued,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) ChatBansIssuedOrErr

func (e UserEdges) ChatBansIssuedOrErr() ([]*ChatBan, error)

ChatBansIssuedOrErr returns the ChatBansIssued value or an error if the edge was not loaded in eager-loading.

func (UserEdges) ChatBansOrErr

func (e UserEdges) ChatBansOrErr() ([]*ChatBan, error)

ChatBansOrErr returns the ChatBans value or an error if the edge was not loaded in eager-loading.

func (UserEdges) ChatMessagesOrErr

func (e UserEdges) ChatMessagesOrErr() ([]*ChatMessage, error)

ChatMessagesOrErr returns the ChatMessages value or an error if the edge was not loaded in eager-loading.

func (UserEdges) OwnedChatRoomsOrErr

func (e UserEdges) OwnedChatRoomsOrErr() ([]*ChatRoom, error)

OwnedChatRoomsOrErr returns the OwnedChatRooms value or an error if the edge was not loaded in eager-loading.

func (UserEdges) OwnerOrErr

func (e UserEdges) OwnerOrErr() ([]*PasswordToken, error)

OwnerOrErr returns the Owner value or an error if the edge was not loaded in eager-loading.

func (UserEdges) PaymentCustomerOrErr

func (e UserEdges) PaymentCustomerOrErr() (*PaymentCustomer, error)

PaymentCustomerOrErr returns the PaymentCustomer value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type UserGroupBy

type UserGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (_g *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupBy) Bool

func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolX

func (s *UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupBy) Bools

func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolsX

func (s *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64X

func (s *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64sX

func (s *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntX

func (s *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntsX

func (s *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupBy) Scan

func (_g *UserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (s *UserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String

func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringX

func (s *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings

func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringsX

func (s *UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserMutation

type UserMutation struct {
	// contains filtered or unexported fields
}

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddChatBanIDs

func (m *UserMutation) AddChatBanIDs(ids ...int)

AddChatBanIDs adds the "chat_bans" edge to the ChatBan entity by ids.

func (*UserMutation) AddChatBansIssuedIDs

func (m *UserMutation) AddChatBansIssuedIDs(ids ...int)

AddChatBansIssuedIDs adds the "chat_bans_issued" edge to the ChatBan entity by ids.

func (*UserMutation) AddChatMessageIDs

func (m *UserMutation) AddChatMessageIDs(ids ...int)

AddChatMessageIDs adds the "chat_messages" edge to the ChatMessage entity by ids.

func (*UserMutation) AddField

func (m *UserMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) AddOwnedChatRoomIDs

func (m *UserMutation) AddOwnedChatRoomIDs(ids ...int)

AddOwnedChatRoomIDs adds the "owned_chat_rooms" edge to the ChatRoom entity by ids.

func (*UserMutation) AddOwnerIDs

func (m *UserMutation) AddOwnerIDs(ids ...int)

AddOwnerIDs adds the "owner" edge to the PasswordToken entity by ids.

func (*UserMutation) AddedEdges

func (m *UserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserMutation) AddedField

func (m *UserMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) AddedFields

func (m *UserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserMutation) AddedIDs

func (m *UserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserMutation) Admin

func (m *UserMutation) Admin() (r bool, exists bool)

Admin returns the value of the "admin" field in the mutation.

func (*UserMutation) ChatBansCleared

func (m *UserMutation) ChatBansCleared() bool

ChatBansCleared reports if the "chat_bans" edge to the ChatBan entity was cleared.

func (*UserMutation) ChatBansIDs

func (m *UserMutation) ChatBansIDs() (ids []int)

ChatBansIDs returns the "chat_bans" edge IDs in the mutation.

func (*UserMutation) ChatBansIssuedCleared

func (m *UserMutation) ChatBansIssuedCleared() bool

ChatBansIssuedCleared reports if the "chat_bans_issued" edge to the ChatBan entity was cleared.

func (*UserMutation) ChatBansIssuedIDs

func (m *UserMutation) ChatBansIssuedIDs() (ids []int)

ChatBansIssuedIDs returns the "chat_bans_issued" edge IDs in the mutation.

func (*UserMutation) ChatMessagesCleared

func (m *UserMutation) ChatMessagesCleared() bool

ChatMessagesCleared reports if the "chat_messages" edge to the ChatMessage entity was cleared.

func (*UserMutation) ChatMessagesIDs

func (m *UserMutation) ChatMessagesIDs() (ids []int)

ChatMessagesIDs returns the "chat_messages" edge IDs in the mutation.

func (*UserMutation) ClearChatBans

func (m *UserMutation) ClearChatBans()

ClearChatBans clears the "chat_bans" edge to the ChatBan entity.

func (*UserMutation) ClearChatBansIssued

func (m *UserMutation) ClearChatBansIssued()

ClearChatBansIssued clears the "chat_bans_issued" edge to the ChatBan entity.

func (*UserMutation) ClearChatMessages

func (m *UserMutation) ClearChatMessages()

ClearChatMessages clears the "chat_messages" edge to the ChatMessage entity.

func (*UserMutation) ClearEdge

func (m *UserMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*UserMutation) ClearField

func (m *UserMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ClearOwnedChatRooms

func (m *UserMutation) ClearOwnedChatRooms()

ClearOwnedChatRooms clears the "owned_chat_rooms" edge to the ChatRoom entity.

func (*UserMutation) ClearOwner

func (m *UserMutation) ClearOwner()

ClearOwner clears the "owner" edge to the PasswordToken entity.

func (*UserMutation) ClearPaymentCustomer

func (m *UserMutation) ClearPaymentCustomer()

ClearPaymentCustomer clears the "payment_customer" edge to the PaymentCustomer entity.

func (*UserMutation) ClearedEdges

func (m *UserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserMutation) ClearedFields

func (m *UserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserMutation) Client

func (m UserMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*UserMutation) CreatedAt

func (m *UserMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*UserMutation) EdgeCleared

func (m *UserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserMutation) Email

func (m *UserMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*UserMutation) Field

func (m *UserMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) FieldCleared

func (m *UserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserMutation) Fields

func (m *UserMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*UserMutation) ID

func (m *UserMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*UserMutation) Name

func (m *UserMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*UserMutation) OldAdmin

func (m *UserMutation) OldAdmin(ctx context.Context) (v bool, err error)

OldAdmin returns the old "admin" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldCreatedAt

func (m *UserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldEmail

func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldField

func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*UserMutation) OldName

func (m *UserMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldPassword

func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldVerified

func (m *UserMutation) OldVerified(ctx context.Context) (v bool, err error)

OldVerified returns the old "verified" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) OwnedChatRoomsCleared

func (m *UserMutation) OwnedChatRoomsCleared() bool

OwnedChatRoomsCleared reports if the "owned_chat_rooms" edge to the ChatRoom entity was cleared.

func (*UserMutation) OwnedChatRoomsIDs

func (m *UserMutation) OwnedChatRoomsIDs() (ids []int)

OwnedChatRoomsIDs returns the "owned_chat_rooms" edge IDs in the mutation.

func (*UserMutation) OwnerCleared

func (m *UserMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the PasswordToken entity was cleared.

func (*UserMutation) OwnerIDs

func (m *UserMutation) OwnerIDs() (ids []int)

OwnerIDs returns the "owner" edge IDs in the mutation.

func (*UserMutation) Password

func (m *UserMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*UserMutation) PaymentCustomerCleared

func (m *UserMutation) PaymentCustomerCleared() bool

PaymentCustomerCleared reports if the "payment_customer" edge to the PaymentCustomer entity was cleared.

func (*UserMutation) PaymentCustomerID

func (m *UserMutation) PaymentCustomerID() (id int, exists bool)

PaymentCustomerID returns the "payment_customer" edge ID in the mutation.

func (*UserMutation) PaymentCustomerIDs

func (m *UserMutation) PaymentCustomerIDs() (ids []int)

PaymentCustomerIDs returns the "payment_customer" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use PaymentCustomerID instead. It exists only for internal usage by the builders.

func (*UserMutation) RemoveChatBanIDs

func (m *UserMutation) RemoveChatBanIDs(ids ...int)

RemoveChatBanIDs removes the "chat_bans" edge to the ChatBan entity by IDs.

func (*UserMutation) RemoveChatBansIssuedIDs

func (m *UserMutation) RemoveChatBansIssuedIDs(ids ...int)

RemoveChatBansIssuedIDs removes the "chat_bans_issued" edge to the ChatBan entity by IDs.

func (*UserMutation) RemoveChatMessageIDs

func (m *UserMutation) RemoveChatMessageIDs(ids ...int)

RemoveChatMessageIDs removes the "chat_messages" edge to the ChatMessage entity by IDs.

func (*UserMutation) RemoveOwnedChatRoomIDs

func (m *UserMutation) RemoveOwnedChatRoomIDs(ids ...int)

RemoveOwnedChatRoomIDs removes the "owned_chat_rooms" edge to the ChatRoom entity by IDs.

func (*UserMutation) RemoveOwnerIDs

func (m *UserMutation) RemoveOwnerIDs(ids ...int)

RemoveOwnerIDs removes the "owner" edge to the PasswordToken entity by IDs.

func (*UserMutation) RemovedChatBansIDs

func (m *UserMutation) RemovedChatBansIDs() (ids []int)

RemovedChatBans returns the removed IDs of the "chat_bans" edge to the ChatBan entity.

func (*UserMutation) RemovedChatBansIssuedIDs

func (m *UserMutation) RemovedChatBansIssuedIDs() (ids []int)

RemovedChatBansIssued returns the removed IDs of the "chat_bans_issued" edge to the ChatBan entity.

func (*UserMutation) RemovedChatMessagesIDs

func (m *UserMutation) RemovedChatMessagesIDs() (ids []int)

RemovedChatMessages returns the removed IDs of the "chat_messages" edge to the ChatMessage entity.

func (*UserMutation) RemovedEdges

func (m *UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserMutation) RemovedIDs

func (m *UserMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*UserMutation) RemovedOwnedChatRoomsIDs

func (m *UserMutation) RemovedOwnedChatRoomsIDs() (ids []int)

RemovedOwnedChatRooms returns the removed IDs of the "owned_chat_rooms" edge to the ChatRoom entity.

func (*UserMutation) RemovedOwnerIDs

func (m *UserMutation) RemovedOwnerIDs() (ids []int)

RemovedOwner returns the removed IDs of the "owner" edge to the PasswordToken entity.

func (*UserMutation) ResetAdmin

func (m *UserMutation) ResetAdmin()

ResetAdmin resets all changes to the "admin" field.

func (*UserMutation) ResetChatBans

func (m *UserMutation) ResetChatBans()

ResetChatBans resets all changes to the "chat_bans" edge.

func (*UserMutation) ResetChatBansIssued

func (m *UserMutation) ResetChatBansIssued()

ResetChatBansIssued resets all changes to the "chat_bans_issued" edge.

func (*UserMutation) ResetChatMessages

func (m *UserMutation) ResetChatMessages()

ResetChatMessages resets all changes to the "chat_messages" edge.

func (*UserMutation) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetEdge

func (m *UserMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*UserMutation) ResetEmail

func (m *UserMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*UserMutation) ResetField

func (m *UserMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ResetName

func (m *UserMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*UserMutation) ResetOwnedChatRooms

func (m *UserMutation) ResetOwnedChatRooms()

ResetOwnedChatRooms resets all changes to the "owned_chat_rooms" edge.

func (*UserMutation) ResetOwner

func (m *UserMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*UserMutation) ResetPassword

func (m *UserMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*UserMutation) ResetPaymentCustomer

func (m *UserMutation) ResetPaymentCustomer()

ResetPaymentCustomer resets all changes to the "payment_customer" edge.

func (*UserMutation) ResetVerified

func (m *UserMutation) ResetVerified()

ResetVerified resets all changes to the "verified" field.

func (*UserMutation) SetAdmin

func (m *UserMutation) SetAdmin(b bool)

SetAdmin sets the "admin" field.

func (*UserMutation) SetCreatedAt

func (m *UserMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*UserMutation) SetEmail

func (m *UserMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*UserMutation) SetField

func (m *UserMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) SetName

func (m *UserMutation) SetName(s string)

SetName sets the "name" field.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetPassword

func (m *UserMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*UserMutation) SetPaymentCustomerID

func (m *UserMutation) SetPaymentCustomerID(id int)

SetPaymentCustomerID sets the "payment_customer" edge to the PaymentCustomer entity by id.

func (*UserMutation) SetVerified

func (m *UserMutation) SetVerified(b bool)

SetVerified sets the "verified" field.

func (UserMutation) Tx

func (m UserMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserMutation) Type

func (m *UserMutation) Type() string

Type returns the node type of this mutation (User).

func (*UserMutation) Verified

func (m *UserMutation) Verified() (r bool, exists bool)

Verified returns the value of the "verified" field in the mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

func (m *UserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate

func (_q *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (_q *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (_q *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (_q *UserQuery) Clone() *UserQuery

Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserQuery) Count

func (_q *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (_q *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) Exist

func (_q *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (_q *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (_q *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (_q *UserQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (_q *UserQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (_q *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy

func (_q *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (_q *UserQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (_q *UserQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (_q *UserQuery) Limit(limit int) *UserQuery

Limit the number of records to be returned by this query.

func (*UserQuery) Offset

func (_q *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

func (*UserQuery) Only

func (_q *UserQuery) Only(ctx context.Context) (*User, error)

Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

func (_q *UserQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (_q *UserQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (_q *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (_q *UserQuery) Order(o ...user.OrderOption) *UserQuery

Order specifies how the records should be ordered.

func (*UserQuery) QueryChatBans

func (_q *UserQuery) QueryChatBans() *ChatBanQuery

QueryChatBans chains the current query on the "chat_bans" edge.

func (*UserQuery) QueryChatBansIssued

func (_q *UserQuery) QueryChatBansIssued() *ChatBanQuery

QueryChatBansIssued chains the current query on the "chat_bans_issued" edge.

func (*UserQuery) QueryChatMessages

func (_q *UserQuery) QueryChatMessages() *ChatMessageQuery

QueryChatMessages chains the current query on the "chat_messages" edge.

func (*UserQuery) QueryOwnedChatRooms

func (_q *UserQuery) QueryOwnedChatRooms() *ChatRoomQuery

QueryOwnedChatRooms chains the current query on the "owned_chat_rooms" edge.

func (*UserQuery) QueryOwner

func (_q *UserQuery) QueryOwner() *PasswordTokenQuery

QueryOwner chains the current query on the "owner" edge.

func (*UserQuery) QueryPaymentCustomer

func (_q *UserQuery) QueryPaymentCustomer() *PaymentCustomerQuery

QueryPaymentCustomer chains the current query on the "payment_customer" edge.

func (*UserQuery) Select

func (_q *UserQuery) Select(fields ...string) *UserSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.User.Query().
	Select(user.FieldName).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (_q *UserQuery) Unique(unique bool) *UserQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*UserQuery) Where

func (_q *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithChatBans

func (_q *UserQuery) WithChatBans(opts ...func(*ChatBanQuery)) *UserQuery

WithChatBans tells the query-builder to eager-load the nodes that are connected to the "chat_bans" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithChatBansIssued

func (_q *UserQuery) WithChatBansIssued(opts ...func(*ChatBanQuery)) *UserQuery

WithChatBansIssued tells the query-builder to eager-load the nodes that are connected to the "chat_bans_issued" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithChatMessages

func (_q *UserQuery) WithChatMessages(opts ...func(*ChatMessageQuery)) *UserQuery

WithChatMessages tells the query-builder to eager-load the nodes that are connected to the "chat_messages" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithOwnedChatRooms

func (_q *UserQuery) WithOwnedChatRooms(opts ...func(*ChatRoomQuery)) *UserQuery

WithOwnedChatRooms tells the query-builder to eager-load the nodes that are connected to the "owned_chat_rooms" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithOwner

func (_q *UserQuery) WithOwner(opts ...func(*PasswordTokenQuery)) *UserQuery

WithOwner tells the query-builder to eager-load the nodes that are connected to the "owner" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithPaymentCustomer

func (_q *UserQuery) WithPaymentCustomer(opts ...func(*PaymentCustomerQuery)) *UserQuery

WithPaymentCustomer tells the query-builder to eager-load the nodes that are connected to the "payment_customer" edge. The optional arguments are used to configure the query builder of the edge.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Aggregate

func (_s *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX

func (s *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX

func (s *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSelect) Float64

func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64X

func (s *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s

func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64sX

func (s *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int

func (s *UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntX

func (s *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints

func (s *UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntsX

func (s *UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserSelect) Scan

func (_s *UserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

func (s *UserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (s *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX

func (s *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (s *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX

func (s *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddChatBanIDs

func (_u *UserUpdate) AddChatBanIDs(ids ...int) *UserUpdate

AddChatBanIDs adds the "chat_bans" edge to the ChatBan entity by IDs.

func (*UserUpdate) AddChatBans

func (_u *UserUpdate) AddChatBans(v ...*ChatBan) *UserUpdate

AddChatBans adds the "chat_bans" edges to the ChatBan entity.

func (*UserUpdate) AddChatBansIssued

func (_u *UserUpdate) AddChatBansIssued(v ...*ChatBan) *UserUpdate

AddChatBansIssued adds the "chat_bans_issued" edges to the ChatBan entity.

func (*UserUpdate) AddChatBansIssuedIDs

func (_u *UserUpdate) AddChatBansIssuedIDs(ids ...int) *UserUpdate

AddChatBansIssuedIDs adds the "chat_bans_issued" edge to the ChatBan entity by IDs.

func (*UserUpdate) AddChatMessageIDs

func (_u *UserUpdate) AddChatMessageIDs(ids ...int) *UserUpdate

AddChatMessageIDs adds the "chat_messages" edge to the ChatMessage entity by IDs.

func (*UserUpdate) AddChatMessages

func (_u *UserUpdate) AddChatMessages(v ...*ChatMessage) *UserUpdate

AddChatMessages adds the "chat_messages" edges to the ChatMessage entity.

func (*UserUpdate) AddOwnedChatRoomIDs

func (_u *UserUpdate) AddOwnedChatRoomIDs(ids ...int) *UserUpdate

AddOwnedChatRoomIDs adds the "owned_chat_rooms" edge to the ChatRoom entity by IDs.

func (*UserUpdate) AddOwnedChatRooms

func (_u *UserUpdate) AddOwnedChatRooms(v ...*ChatRoom) *UserUpdate

AddOwnedChatRooms adds the "owned_chat_rooms" edges to the ChatRoom entity.

func (*UserUpdate) AddOwner

func (_u *UserUpdate) AddOwner(v ...*PasswordToken) *UserUpdate

AddOwner adds the "owner" edges to the PasswordToken entity.

func (*UserUpdate) AddOwnerIDs

func (_u *UserUpdate) AddOwnerIDs(ids ...int) *UserUpdate

AddOwnerIDs adds the "owner" edge to the PasswordToken entity by IDs.

func (*UserUpdate) ClearChatBans

func (_u *UserUpdate) ClearChatBans() *UserUpdate

ClearChatBans clears all "chat_bans" edges to the ChatBan entity.

func (*UserUpdate) ClearChatBansIssued

func (_u *UserUpdate) ClearChatBansIssued() *UserUpdate

ClearChatBansIssued clears all "chat_bans_issued" edges to the ChatBan entity.

func (*UserUpdate) ClearChatMessages

func (_u *UserUpdate) ClearChatMessages() *UserUpdate

ClearChatMessages clears all "chat_messages" edges to the ChatMessage entity.

func (*UserUpdate) ClearOwnedChatRooms

func (_u *UserUpdate) ClearOwnedChatRooms() *UserUpdate

ClearOwnedChatRooms clears all "owned_chat_rooms" edges to the ChatRoom entity.

func (*UserUpdate) ClearOwner

func (_u *UserUpdate) ClearOwner() *UserUpdate

ClearOwner clears all "owner" edges to the PasswordToken entity.

func (*UserUpdate) ClearPaymentCustomer

func (_u *UserUpdate) ClearPaymentCustomer() *UserUpdate

ClearPaymentCustomer clears the "payment_customer" edge to the PaymentCustomer entity.

func (*UserUpdate) Exec

func (_u *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (_u *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (_u *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveChatBanIDs

func (_u *UserUpdate) RemoveChatBanIDs(ids ...int) *UserUpdate

RemoveChatBanIDs removes the "chat_bans" edge to ChatBan entities by IDs.

func (*UserUpdate) RemoveChatBans

func (_u *UserUpdate) RemoveChatBans(v ...*ChatBan) *UserUpdate

RemoveChatBans removes "chat_bans" edges to ChatBan entities.

func (*UserUpdate) RemoveChatBansIssued

func (_u *UserUpdate) RemoveChatBansIssued(v ...*ChatBan) *UserUpdate

RemoveChatBansIssued removes "chat_bans_issued" edges to ChatBan entities.

func (*UserUpdate) RemoveChatBansIssuedIDs

func (_u *UserUpdate) RemoveChatBansIssuedIDs(ids ...int) *UserUpdate

RemoveChatBansIssuedIDs removes the "chat_bans_issued" edge to ChatBan entities by IDs.

func (*UserUpdate) RemoveChatMessageIDs

func (_u *UserUpdate) RemoveChatMessageIDs(ids ...int) *UserUpdate

RemoveChatMessageIDs removes the "chat_messages" edge to ChatMessage entities by IDs.

func (*UserUpdate) RemoveChatMessages

func (_u *UserUpdate) RemoveChatMessages(v ...*ChatMessage) *UserUpdate

RemoveChatMessages removes "chat_messages" edges to ChatMessage entities.

func (*UserUpdate) RemoveOwnedChatRoomIDs

func (_u *UserUpdate) RemoveOwnedChatRoomIDs(ids ...int) *UserUpdate

RemoveOwnedChatRoomIDs removes the "owned_chat_rooms" edge to ChatRoom entities by IDs.

func (*UserUpdate) RemoveOwnedChatRooms

func (_u *UserUpdate) RemoveOwnedChatRooms(v ...*ChatRoom) *UserUpdate

RemoveOwnedChatRooms removes "owned_chat_rooms" edges to ChatRoom entities.

func (*UserUpdate) RemoveOwner

func (_u *UserUpdate) RemoveOwner(v ...*PasswordToken) *UserUpdate

RemoveOwner removes "owner" edges to PasswordToken entities.

func (*UserUpdate) RemoveOwnerIDs

func (_u *UserUpdate) RemoveOwnerIDs(ids ...int) *UserUpdate

RemoveOwnerIDs removes the "owner" edge to PasswordToken entities by IDs.

func (*UserUpdate) Save

func (_u *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserUpdate) SaveX

func (_u *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) SetAdmin

func (_u *UserUpdate) SetAdmin(v bool) *UserUpdate

SetAdmin sets the "admin" field.

func (*UserUpdate) SetEmail

func (_u *UserUpdate) SetEmail(v string) *UserUpdate

SetEmail sets the "email" field.

func (*UserUpdate) SetName

func (_u *UserUpdate) SetName(v string) *UserUpdate

SetName sets the "name" field.

func (*UserUpdate) SetNillableAdmin

func (_u *UserUpdate) SetNillableAdmin(v *bool) *UserUpdate

SetNillableAdmin sets the "admin" field if the given value is not nil.

func (*UserUpdate) SetNillableEmail

func (_u *UserUpdate) SetNillableEmail(v *string) *UserUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdate) SetNillableName

func (_u *UserUpdate) SetNillableName(v *string) *UserUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*UserUpdate) SetNillablePassword

func (_u *UserUpdate) SetNillablePassword(v *string) *UserUpdate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdate) SetNillablePaymentCustomerID

func (_u *UserUpdate) SetNillablePaymentCustomerID(id *int) *UserUpdate

SetNillablePaymentCustomerID sets the "payment_customer" edge to the PaymentCustomer entity by ID if the given value is not nil.

func (*UserUpdate) SetNillableVerified

func (_u *UserUpdate) SetNillableVerified(v *bool) *UserUpdate

SetNillableVerified sets the "verified" field if the given value is not nil.

func (*UserUpdate) SetPassword

func (_u *UserUpdate) SetPassword(v string) *UserUpdate

SetPassword sets the "password" field.

func (*UserUpdate) SetPaymentCustomer

func (_u *UserUpdate) SetPaymentCustomer(v *PaymentCustomer) *UserUpdate

SetPaymentCustomer sets the "payment_customer" edge to the PaymentCustomer entity.

func (*UserUpdate) SetPaymentCustomerID

func (_u *UserUpdate) SetPaymentCustomerID(id int) *UserUpdate

SetPaymentCustomerID sets the "payment_customer" edge to the PaymentCustomer entity by ID.

func (*UserUpdate) SetVerified

func (_u *UserUpdate) SetVerified(v bool) *UserUpdate

SetVerified sets the "verified" field.

func (*UserUpdate) Where

func (_u *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

type UserUpdateOne struct {
	// contains filtered or unexported fields
}

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddChatBanIDs

func (_u *UserUpdateOne) AddChatBanIDs(ids ...int) *UserUpdateOne

AddChatBanIDs adds the "chat_bans" edge to the ChatBan entity by IDs.

func (*UserUpdateOne) AddChatBans

func (_u *UserUpdateOne) AddChatBans(v ...*ChatBan) *UserUpdateOne

AddChatBans adds the "chat_bans" edges to the ChatBan entity.

func (*UserUpdateOne) AddChatBansIssued

func (_u *UserUpdateOne) AddChatBansIssued(v ...*ChatBan) *UserUpdateOne

AddChatBansIssued adds the "chat_bans_issued" edges to the ChatBan entity.

func (*UserUpdateOne) AddChatBansIssuedIDs

func (_u *UserUpdateOne) AddChatBansIssuedIDs(ids ...int) *UserUpdateOne

AddChatBansIssuedIDs adds the "chat_bans_issued" edge to the ChatBan entity by IDs.

func (*UserUpdateOne) AddChatMessageIDs

func (_u *UserUpdateOne) AddChatMessageIDs(ids ...int) *UserUpdateOne

AddChatMessageIDs adds the "chat_messages" edge to the ChatMessage entity by IDs.

func (*UserUpdateOne) AddChatMessages

func (_u *UserUpdateOne) AddChatMessages(v ...*ChatMessage) *UserUpdateOne

AddChatMessages adds the "chat_messages" edges to the ChatMessage entity.

func (*UserUpdateOne) AddOwnedChatRoomIDs

func (_u *UserUpdateOne) AddOwnedChatRoomIDs(ids ...int) *UserUpdateOne

AddOwnedChatRoomIDs adds the "owned_chat_rooms" edge to the ChatRoom entity by IDs.

func (*UserUpdateOne) AddOwnedChatRooms

func (_u *UserUpdateOne) AddOwnedChatRooms(v ...*ChatRoom) *UserUpdateOne

AddOwnedChatRooms adds the "owned_chat_rooms" edges to the ChatRoom entity.

func (*UserUpdateOne) AddOwner

func (_u *UserUpdateOne) AddOwner(v ...*PasswordToken) *UserUpdateOne

AddOwner adds the "owner" edges to the PasswordToken entity.

func (*UserUpdateOne) AddOwnerIDs

func (_u *UserUpdateOne) AddOwnerIDs(ids ...int) *UserUpdateOne

AddOwnerIDs adds the "owner" edge to the PasswordToken entity by IDs.

func (*UserUpdateOne) ClearChatBans

func (_u *UserUpdateOne) ClearChatBans() *UserUpdateOne

ClearChatBans clears all "chat_bans" edges to the ChatBan entity.

func (*UserUpdateOne) ClearChatBansIssued

func (_u *UserUpdateOne) ClearChatBansIssued() *UserUpdateOne

ClearChatBansIssued clears all "chat_bans_issued" edges to the ChatBan entity.

func (*UserUpdateOne) ClearChatMessages

func (_u *UserUpdateOne) ClearChatMessages() *UserUpdateOne

ClearChatMessages clears all "chat_messages" edges to the ChatMessage entity.

func (*UserUpdateOne) ClearOwnedChatRooms

func (_u *UserUpdateOne) ClearOwnedChatRooms() *UserUpdateOne

ClearOwnedChatRooms clears all "owned_chat_rooms" edges to the ChatRoom entity.

func (*UserUpdateOne) ClearOwner

func (_u *UserUpdateOne) ClearOwner() *UserUpdateOne

ClearOwner clears all "owner" edges to the PasswordToken entity.

func (*UserUpdateOne) ClearPaymentCustomer

func (_u *UserUpdateOne) ClearPaymentCustomer() *UserUpdateOne

ClearPaymentCustomer clears the "payment_customer" edge to the PaymentCustomer entity.

func (*UserUpdateOne) Exec

func (_u *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (_u *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation

func (_u *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemoveChatBanIDs

func (_u *UserUpdateOne) RemoveChatBanIDs(ids ...int) *UserUpdateOne

RemoveChatBanIDs removes the "chat_bans" edge to ChatBan entities by IDs.

func (*UserUpdateOne) RemoveChatBans

func (_u *UserUpdateOne) RemoveChatBans(v ...*ChatBan) *UserUpdateOne

RemoveChatBans removes "chat_bans" edges to ChatBan entities.

func (*UserUpdateOne) RemoveChatBansIssued

func (_u *UserUpdateOne) RemoveChatBansIssued(v ...*ChatBan) *UserUpdateOne

RemoveChatBansIssued removes "chat_bans_issued" edges to ChatBan entities.

func (*UserUpdateOne) RemoveChatBansIssuedIDs

func (_u *UserUpdateOne) RemoveChatBansIssuedIDs(ids ...int) *UserUpdateOne

RemoveChatBansIssuedIDs removes the "chat_bans_issued" edge to ChatBan entities by IDs.

func (*UserUpdateOne) RemoveChatMessageIDs

func (_u *UserUpdateOne) RemoveChatMessageIDs(ids ...int) *UserUpdateOne

RemoveChatMessageIDs removes the "chat_messages" edge to ChatMessage entities by IDs.

func (*UserUpdateOne) RemoveChatMessages

func (_u *UserUpdateOne) RemoveChatMessages(v ...*ChatMessage) *UserUpdateOne

RemoveChatMessages removes "chat_messages" edges to ChatMessage entities.

func (*UserUpdateOne) RemoveOwnedChatRoomIDs

func (_u *UserUpdateOne) RemoveOwnedChatRoomIDs(ids ...int) *UserUpdateOne

RemoveOwnedChatRoomIDs removes the "owned_chat_rooms" edge to ChatRoom entities by IDs.

func (*UserUpdateOne) RemoveOwnedChatRooms

func (_u *UserUpdateOne) RemoveOwnedChatRooms(v ...*ChatRoom) *UserUpdateOne

RemoveOwnedChatRooms removes "owned_chat_rooms" edges to ChatRoom entities.

func (*UserUpdateOne) RemoveOwner

func (_u *UserUpdateOne) RemoveOwner(v ...*PasswordToken) *UserUpdateOne

RemoveOwner removes "owner" edges to PasswordToken entities.

func (*UserUpdateOne) RemoveOwnerIDs

func (_u *UserUpdateOne) RemoveOwnerIDs(ids ...int) *UserUpdateOne

RemoveOwnerIDs removes the "owner" edge to PasswordToken entities by IDs.

func (*UserUpdateOne) Save

func (_u *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (_u *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (_u *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserUpdateOne) SetAdmin

func (_u *UserUpdateOne) SetAdmin(v bool) *UserUpdateOne

SetAdmin sets the "admin" field.

func (*UserUpdateOne) SetEmail

func (_u *UserUpdateOne) SetEmail(v string) *UserUpdateOne

SetEmail sets the "email" field.

func (*UserUpdateOne) SetName

func (_u *UserUpdateOne) SetName(v string) *UserUpdateOne

SetName sets the "name" field.

func (*UserUpdateOne) SetNillableAdmin

func (_u *UserUpdateOne) SetNillableAdmin(v *bool) *UserUpdateOne

SetNillableAdmin sets the "admin" field if the given value is not nil.

func (*UserUpdateOne) SetNillableEmail

func (_u *UserUpdateOne) SetNillableEmail(v *string) *UserUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdateOne) SetNillableName

func (_u *UserUpdateOne) SetNillableName(v *string) *UserUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePassword

func (_u *UserUpdateOne) SetNillablePassword(v *string) *UserUpdateOne

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePaymentCustomerID

func (_u *UserUpdateOne) SetNillablePaymentCustomerID(id *int) *UserUpdateOne

SetNillablePaymentCustomerID sets the "payment_customer" edge to the PaymentCustomer entity by ID if the given value is not nil.

func (*UserUpdateOne) SetNillableVerified

func (_u *UserUpdateOne) SetNillableVerified(v *bool) *UserUpdateOne

SetNillableVerified sets the "verified" field if the given value is not nil.

func (*UserUpdateOne) SetPassword

func (_u *UserUpdateOne) SetPassword(v string) *UserUpdateOne

SetPassword sets the "password" field.

func (*UserUpdateOne) SetPaymentCustomer

func (_u *UserUpdateOne) SetPaymentCustomer(v *PaymentCustomer) *UserUpdateOne

SetPaymentCustomer sets the "payment_customer" edge to the PaymentCustomer entity.

func (*UserUpdateOne) SetPaymentCustomerID

func (_u *UserUpdateOne) SetPaymentCustomerID(id int) *UserUpdateOne

SetPaymentCustomerID sets the "payment_customer" edge to the PaymentCustomer entity by ID.

func (*UserUpdateOne) SetVerified

func (_u *UserUpdateOne) SetVerified(v bool) *UserUpdateOne

SetVerified sets the "verified" field.

func (*UserUpdateOne) Where

func (_u *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis
Code generated by ent, DO NOT EDIT.
Code generated by ent, DO NOT EDIT.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL