db

package
v1.0.0-beta.168 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: Apache-2.0 Imports: 35 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.
	TypeBalanceSnapshot                 = "BalanceSnapshot"
	TypeEntitlement                     = "Entitlement"
	TypeFeature                         = "Feature"
	TypeGrant                           = "Grant"
	TypeNotificationChannel             = "NotificationChannel"
	TypeNotificationEvent               = "NotificationEvent"
	TypeNotificationEventDeliveryStatus = "NotificationEventDeliveryStatus"
	TypeNotificationRule                = "NotificationRule"
	TypeUsageReset                      = "UsageReset"
)

Variables

View Source
var ErrTxStarted = errors.New("db: 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(db.As(db.Sum(field1), "sum_field1"), (db.As(db.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 BalanceSnapshot

type BalanceSnapshot struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Namespace holds the value of the "namespace" field.
	Namespace string `json:"namespace,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"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// OwnerID holds the value of the "owner_id" field.
	OwnerID string `json:"owner_id,omitempty"`
	// GrantBalances holds the value of the "grant_balances" field.
	GrantBalances balance.Map `json:"grant_balances,omitempty"`
	// Balance holds the value of the "balance" field.
	Balance float64 `json:"balance,omitempty"`
	// Overage holds the value of the "overage" field.
	Overage float64 `json:"overage,omitempty"`
	// At holds the value of the "at" field.
	At time.Time `json:"at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the BalanceSnapshotQuery when eager-loading is set.
	Edges BalanceSnapshotEdges `json:"edges"`
	// contains filtered or unexported fields
}

BalanceSnapshot is the model entity for the BalanceSnapshot schema.

func (*BalanceSnapshot) QueryEntitlement

func (bs *BalanceSnapshot) QueryEntitlement() *EntitlementQuery

QueryEntitlement queries the "entitlement" edge of the BalanceSnapshot entity.

func (*BalanceSnapshot) String

func (bs *BalanceSnapshot) String() string

String implements the fmt.Stringer.

func (*BalanceSnapshot) Unwrap

func (bs *BalanceSnapshot) Unwrap() *BalanceSnapshot

Unwrap unwraps the BalanceSnapshot 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 (*BalanceSnapshot) Update

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

func (*BalanceSnapshot) Value

func (bs *BalanceSnapshot) Value(name string) (ent.Value, error)

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

type BalanceSnapshotClient

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

BalanceSnapshotClient is a client for the BalanceSnapshot schema.

func NewBalanceSnapshotClient

func NewBalanceSnapshotClient(c config) *BalanceSnapshotClient

NewBalanceSnapshotClient returns a client for the BalanceSnapshot from the given config.

func (*BalanceSnapshotClient) Create

Create returns a builder for creating a BalanceSnapshot entity.

func (*BalanceSnapshotClient) CreateBulk

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

func (*BalanceSnapshotClient) Delete

Delete returns a delete builder for BalanceSnapshot.

func (*BalanceSnapshotClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*BalanceSnapshotClient) DeleteOneID

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

func (*BalanceSnapshotClient) Get

Get returns a BalanceSnapshot entity by its id.

func (*BalanceSnapshotClient) GetX

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

func (*BalanceSnapshotClient) Hooks

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

Hooks returns the client hooks.

func (*BalanceSnapshotClient) Intercept

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

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

func (*BalanceSnapshotClient) Interceptors

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

Interceptors returns the client interceptors.

func (*BalanceSnapshotClient) MapCreateBulk

func (c *BalanceSnapshotClient) MapCreateBulk(slice any, setFunc func(*BalanceSnapshotCreate, int)) *BalanceSnapshotCreateBulk

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 (*BalanceSnapshotClient) Query

Query returns a query builder for BalanceSnapshot.

func (*BalanceSnapshotClient) QueryEntitlement

func (c *BalanceSnapshotClient) QueryEntitlement(bs *BalanceSnapshot) *EntitlementQuery

QueryEntitlement queries the entitlement edge of a BalanceSnapshot.

func (*BalanceSnapshotClient) Update

Update returns an update builder for BalanceSnapshot.

func (*BalanceSnapshotClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*BalanceSnapshotClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*BalanceSnapshotClient) Use

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

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

type BalanceSnapshotCreate

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

BalanceSnapshotCreate is the builder for creating a BalanceSnapshot entity.

func (*BalanceSnapshotCreate) Exec

func (bsc *BalanceSnapshotCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*BalanceSnapshotCreate) ExecX

func (bsc *BalanceSnapshotCreate) ExecX(ctx context.Context)

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

func (*BalanceSnapshotCreate) Mutation

Mutation returns the BalanceSnapshotMutation object of the builder.

func (*BalanceSnapshotCreate) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.BalanceSnapshot.Create().
	SetNamespace(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.BalanceSnapshotUpsert) {
		SetNamespace(v+v).
	}).
	Exec(ctx)

func (*BalanceSnapshotCreate) OnConflictColumns

func (bsc *BalanceSnapshotCreate) OnConflictColumns(columns ...string) *BalanceSnapshotUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.BalanceSnapshot.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*BalanceSnapshotCreate) Save

Save creates the BalanceSnapshot in the database.

func (*BalanceSnapshotCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*BalanceSnapshotCreate) SetAt

SetAt sets the "at" field.

func (*BalanceSnapshotCreate) SetBalance

SetBalance sets the "balance" field.

func (*BalanceSnapshotCreate) SetCreatedAt

func (bsc *BalanceSnapshotCreate) SetCreatedAt(t time.Time) *BalanceSnapshotCreate

SetCreatedAt sets the "created_at" field.

func (*BalanceSnapshotCreate) SetDeletedAt

func (bsc *BalanceSnapshotCreate) SetDeletedAt(t time.Time) *BalanceSnapshotCreate

SetDeletedAt sets the "deleted_at" field.

func (*BalanceSnapshotCreate) SetEntitlement

func (bsc *BalanceSnapshotCreate) SetEntitlement(e *Entitlement) *BalanceSnapshotCreate

SetEntitlement sets the "entitlement" edge to the Entitlement entity.

func (*BalanceSnapshotCreate) SetEntitlementID

func (bsc *BalanceSnapshotCreate) SetEntitlementID(id string) *BalanceSnapshotCreate

SetEntitlementID sets the "entitlement" edge to the Entitlement entity by ID.

func (*BalanceSnapshotCreate) SetGrantBalances

func (bsc *BalanceSnapshotCreate) SetGrantBalances(b balance.Map) *BalanceSnapshotCreate

SetGrantBalances sets the "grant_balances" field.

func (*BalanceSnapshotCreate) SetNamespace

func (bsc *BalanceSnapshotCreate) SetNamespace(s string) *BalanceSnapshotCreate

SetNamespace sets the "namespace" field.

func (*BalanceSnapshotCreate) SetNillableCreatedAt

func (bsc *BalanceSnapshotCreate) SetNillableCreatedAt(t *time.Time) *BalanceSnapshotCreate

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

func (*BalanceSnapshotCreate) SetNillableDeletedAt

func (bsc *BalanceSnapshotCreate) SetNillableDeletedAt(t *time.Time) *BalanceSnapshotCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*BalanceSnapshotCreate) SetNillableUpdatedAt

func (bsc *BalanceSnapshotCreate) SetNillableUpdatedAt(t *time.Time) *BalanceSnapshotCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*BalanceSnapshotCreate) SetOverage

SetOverage sets the "overage" field.

func (*BalanceSnapshotCreate) SetOwnerID

SetOwnerID sets the "owner_id" field.

func (*BalanceSnapshotCreate) SetUpdatedAt

func (bsc *BalanceSnapshotCreate) SetUpdatedAt(t time.Time) *BalanceSnapshotCreate

SetUpdatedAt sets the "updated_at" field.

type BalanceSnapshotCreateBulk

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

BalanceSnapshotCreateBulk is the builder for creating many BalanceSnapshot entities in bulk.

func (*BalanceSnapshotCreateBulk) Exec

Exec executes the query.

func (*BalanceSnapshotCreateBulk) ExecX

func (bscb *BalanceSnapshotCreateBulk) ExecX(ctx context.Context)

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

func (*BalanceSnapshotCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.BalanceSnapshot.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.BalanceSnapshotUpsert) {
		SetNamespace(v+v).
	}).
	Exec(ctx)

func (*BalanceSnapshotCreateBulk) OnConflictColumns

func (bscb *BalanceSnapshotCreateBulk) OnConflictColumns(columns ...string) *BalanceSnapshotUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.BalanceSnapshot.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*BalanceSnapshotCreateBulk) Save

Save creates the BalanceSnapshot entities in the database.

func (*BalanceSnapshotCreateBulk) SaveX

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

type BalanceSnapshotDelete

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

BalanceSnapshotDelete is the builder for deleting a BalanceSnapshot entity.

func (*BalanceSnapshotDelete) Exec

func (bsd *BalanceSnapshotDelete) Exec(ctx context.Context) (int, error)

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

func (*BalanceSnapshotDelete) ExecX

func (bsd *BalanceSnapshotDelete) ExecX(ctx context.Context) int

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

func (*BalanceSnapshotDelete) Where

Where appends a list predicates to the BalanceSnapshotDelete builder.

type BalanceSnapshotDeleteOne

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

BalanceSnapshotDeleteOne is the builder for deleting a single BalanceSnapshot entity.

func (*BalanceSnapshotDeleteOne) Exec

Exec executes the deletion query.

func (*BalanceSnapshotDeleteOne) ExecX

func (bsdo *BalanceSnapshotDeleteOne) ExecX(ctx context.Context)

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

func (*BalanceSnapshotDeleteOne) Where

Where appends a list predicates to the BalanceSnapshotDelete builder.

type BalanceSnapshotEdges

type BalanceSnapshotEdges struct {
	// Entitlement holds the value of the entitlement edge.
	Entitlement *Entitlement `json:"entitlement,omitempty"`
	// contains filtered or unexported fields
}

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

func (BalanceSnapshotEdges) EntitlementOrErr

func (e BalanceSnapshotEdges) EntitlementOrErr() (*Entitlement, error)

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

type BalanceSnapshotGroupBy

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

BalanceSnapshotGroupBy is the group-by builder for BalanceSnapshot entities.

func (*BalanceSnapshotGroupBy) Aggregate

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

func (*BalanceSnapshotGroupBy) Bool

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

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

func (*BalanceSnapshotGroupBy) BoolX

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

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

func (*BalanceSnapshotGroupBy) Bools

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

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

func (*BalanceSnapshotGroupBy) BoolsX

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

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

func (*BalanceSnapshotGroupBy) Float64

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

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

func (*BalanceSnapshotGroupBy) Float64X

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

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

func (*BalanceSnapshotGroupBy) Float64s

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

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

func (*BalanceSnapshotGroupBy) Float64sX

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

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

func (*BalanceSnapshotGroupBy) Int

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

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

func (*BalanceSnapshotGroupBy) IntX

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

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

func (*BalanceSnapshotGroupBy) Ints

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

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

func (*BalanceSnapshotGroupBy) IntsX

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

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

func (*BalanceSnapshotGroupBy) Scan

func (bsgb *BalanceSnapshotGroupBy) Scan(ctx context.Context, v any) error

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

func (*BalanceSnapshotGroupBy) ScanX

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

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

func (*BalanceSnapshotGroupBy) String

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

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

func (*BalanceSnapshotGroupBy) StringX

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

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

func (*BalanceSnapshotGroupBy) Strings

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

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

func (*BalanceSnapshotGroupBy) StringsX

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

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

type BalanceSnapshotMutation

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

BalanceSnapshotMutation represents an operation that mutates the BalanceSnapshot nodes in the graph.

func (*BalanceSnapshotMutation) AddBalance

func (m *BalanceSnapshotMutation) AddBalance(f float64)

AddBalance adds f to the "balance" field.

func (*BalanceSnapshotMutation) AddField

func (m *BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) AddOverage

func (m *BalanceSnapshotMutation) AddOverage(f float64)

AddOverage adds f to the "overage" field.

func (*BalanceSnapshotMutation) AddedBalance

func (m *BalanceSnapshotMutation) AddedBalance() (r float64, exists bool)

AddedBalance returns the value that was added to the "balance" field in this mutation.

func (*BalanceSnapshotMutation) AddedEdges

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

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

func (*BalanceSnapshotMutation) AddedField

func (m *BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) AddedFields

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

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

func (*BalanceSnapshotMutation) AddedIDs

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

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

func (*BalanceSnapshotMutation) AddedOverage

func (m *BalanceSnapshotMutation) AddedOverage() (r float64, exists bool)

AddedOverage returns the value that was added to the "overage" field in this mutation.

func (*BalanceSnapshotMutation) At

func (m *BalanceSnapshotMutation) At() (r time.Time, exists bool)

At returns the value of the "at" field in the mutation.

func (*BalanceSnapshotMutation) Balance

func (m *BalanceSnapshotMutation) Balance() (r float64, exists bool)

Balance returns the value of the "balance" field in the mutation.

func (*BalanceSnapshotMutation) ClearDeletedAt

func (m *BalanceSnapshotMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*BalanceSnapshotMutation) ClearEdge

func (m *BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) ClearEntitlement

func (m *BalanceSnapshotMutation) ClearEntitlement()

ClearEntitlement clears the "entitlement" edge to the Entitlement entity.

func (*BalanceSnapshotMutation) ClearField

func (m *BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) ClearedEdges

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

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

func (*BalanceSnapshotMutation) ClearedFields

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

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

func (BalanceSnapshotMutation) Client

func (m BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) CreatedAt

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

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

func (*BalanceSnapshotMutation) DeletedAt

func (m *BalanceSnapshotMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*BalanceSnapshotMutation) DeletedAtCleared

func (m *BalanceSnapshotMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*BalanceSnapshotMutation) EdgeCleared

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

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

func (*BalanceSnapshotMutation) EntitlementCleared

func (m *BalanceSnapshotMutation) EntitlementCleared() bool

EntitlementCleared reports if the "entitlement" edge to the Entitlement entity was cleared.

func (*BalanceSnapshotMutation) EntitlementID

func (m *BalanceSnapshotMutation) EntitlementID() (id string, exists bool)

EntitlementID returns the "entitlement" edge ID in the mutation.

func (*BalanceSnapshotMutation) EntitlementIDs

func (m *BalanceSnapshotMutation) EntitlementIDs() (ids []string)

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

func (*BalanceSnapshotMutation) Field

func (m *BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) FieldCleared

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

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

func (*BalanceSnapshotMutation) Fields

func (m *BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) GrantBalances

func (m *BalanceSnapshotMutation) GrantBalances() (r balance.Map, exists bool)

GrantBalances returns the value of the "grant_balances" field in the mutation.

func (*BalanceSnapshotMutation) ID

func (m *BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) IDs

func (m *BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) Namespace

func (m *BalanceSnapshotMutation) Namespace() (r string, exists bool)

Namespace returns the value of the "namespace" field in the mutation.

func (*BalanceSnapshotMutation) OldAt

func (m *BalanceSnapshotMutation) OldAt(ctx context.Context) (v time.Time, err error)

OldAt returns the old "at" field's value of the BalanceSnapshot entity. If the BalanceSnapshot 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 (*BalanceSnapshotMutation) OldBalance

func (m *BalanceSnapshotMutation) OldBalance(ctx context.Context) (v float64, err error)

OldBalance returns the old "balance" field's value of the BalanceSnapshot entity. If the BalanceSnapshot 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 (*BalanceSnapshotMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the BalanceSnapshot entity. If the BalanceSnapshot 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 (*BalanceSnapshotMutation) OldDeletedAt

func (m *BalanceSnapshotMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the BalanceSnapshot entity. If the BalanceSnapshot 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 (*BalanceSnapshotMutation) OldField

func (m *BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) OldGrantBalances

func (m *BalanceSnapshotMutation) OldGrantBalances(ctx context.Context) (v balance.Map, err error)

OldGrantBalances returns the old "grant_balances" field's value of the BalanceSnapshot entity. If the BalanceSnapshot 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 (*BalanceSnapshotMutation) OldNamespace

func (m *BalanceSnapshotMutation) OldNamespace(ctx context.Context) (v string, err error)

OldNamespace returns the old "namespace" field's value of the BalanceSnapshot entity. If the BalanceSnapshot 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 (*BalanceSnapshotMutation) OldOverage

func (m *BalanceSnapshotMutation) OldOverage(ctx context.Context) (v float64, err error)

OldOverage returns the old "overage" field's value of the BalanceSnapshot entity. If the BalanceSnapshot 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 (*BalanceSnapshotMutation) OldOwnerID

func (m *BalanceSnapshotMutation) OldOwnerID(ctx context.Context) (v string, err error)

OldOwnerID returns the old "owner_id" field's value of the BalanceSnapshot entity. If the BalanceSnapshot 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 (*BalanceSnapshotMutation) OldUpdatedAt

func (m *BalanceSnapshotMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the BalanceSnapshot entity. If the BalanceSnapshot 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 (*BalanceSnapshotMutation) Op

func (m *BalanceSnapshotMutation) Op() Op

Op returns the operation name.

func (*BalanceSnapshotMutation) Overage

func (m *BalanceSnapshotMutation) Overage() (r float64, exists bool)

Overage returns the value of the "overage" field in the mutation.

func (*BalanceSnapshotMutation) OwnerID

func (m *BalanceSnapshotMutation) OwnerID() (r string, exists bool)

OwnerID returns the value of the "owner_id" field in the mutation.

func (*BalanceSnapshotMutation) RemovedEdges

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

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

func (*BalanceSnapshotMutation) RemovedIDs

func (m *BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) ResetAt

func (m *BalanceSnapshotMutation) ResetAt()

ResetAt resets all changes to the "at" field.

func (*BalanceSnapshotMutation) ResetBalance

func (m *BalanceSnapshotMutation) ResetBalance()

ResetBalance resets all changes to the "balance" field.

func (*BalanceSnapshotMutation) ResetCreatedAt

func (m *BalanceSnapshotMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*BalanceSnapshotMutation) ResetDeletedAt

func (m *BalanceSnapshotMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*BalanceSnapshotMutation) ResetEdge

func (m *BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) ResetEntitlement

func (m *BalanceSnapshotMutation) ResetEntitlement()

ResetEntitlement resets all changes to the "entitlement" edge.

func (*BalanceSnapshotMutation) ResetField

func (m *BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) ResetGrantBalances

func (m *BalanceSnapshotMutation) ResetGrantBalances()

ResetGrantBalances resets all changes to the "grant_balances" field.

func (*BalanceSnapshotMutation) ResetNamespace

func (m *BalanceSnapshotMutation) ResetNamespace()

ResetNamespace resets all changes to the "namespace" field.

func (*BalanceSnapshotMutation) ResetOverage

func (m *BalanceSnapshotMutation) ResetOverage()

ResetOverage resets all changes to the "overage" field.

func (*BalanceSnapshotMutation) ResetOwnerID

func (m *BalanceSnapshotMutation) ResetOwnerID()

ResetOwnerID resets all changes to the "owner_id" field.

func (*BalanceSnapshotMutation) ResetUpdatedAt

func (m *BalanceSnapshotMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*BalanceSnapshotMutation) SetAt

func (m *BalanceSnapshotMutation) SetAt(t time.Time)

SetAt sets the "at" field.

func (*BalanceSnapshotMutation) SetBalance

func (m *BalanceSnapshotMutation) SetBalance(f float64)

SetBalance sets the "balance" field.

func (*BalanceSnapshotMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*BalanceSnapshotMutation) SetDeletedAt

func (m *BalanceSnapshotMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*BalanceSnapshotMutation) SetEntitlementID

func (m *BalanceSnapshotMutation) SetEntitlementID(id string)

SetEntitlementID sets the "entitlement" edge to the Entitlement entity by id.

func (*BalanceSnapshotMutation) SetField

func (m *BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) SetGrantBalances

func (m *BalanceSnapshotMutation) SetGrantBalances(b balance.Map)

SetGrantBalances sets the "grant_balances" field.

func (*BalanceSnapshotMutation) SetNamespace

func (m *BalanceSnapshotMutation) SetNamespace(s string)

SetNamespace sets the "namespace" field.

func (*BalanceSnapshotMutation) SetOp

func (m *BalanceSnapshotMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*BalanceSnapshotMutation) SetOverage

func (m *BalanceSnapshotMutation) SetOverage(f float64)

SetOverage sets the "overage" field.

func (*BalanceSnapshotMutation) SetOwnerID

func (m *BalanceSnapshotMutation) SetOwnerID(s string)

SetOwnerID sets the "owner_id" field.

func (*BalanceSnapshotMutation) SetUpdatedAt

func (m *BalanceSnapshotMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (BalanceSnapshotMutation) Tx

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

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

func (*BalanceSnapshotMutation) Type

func (m *BalanceSnapshotMutation) Type() string

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

func (*BalanceSnapshotMutation) UpdatedAt

func (m *BalanceSnapshotMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*BalanceSnapshotMutation) Where

Where appends a list predicates to the BalanceSnapshotMutation builder.

func (*BalanceSnapshotMutation) WhereP

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

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

type BalanceSnapshotQuery

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

BalanceSnapshotQuery is the builder for querying BalanceSnapshot entities.

func (*BalanceSnapshotQuery) Aggregate

Aggregate returns a BalanceSnapshotSelect configured with the given aggregations.

func (*BalanceSnapshotQuery) All

All executes the query and returns a list of BalanceSnapshots.

func (*BalanceSnapshotQuery) AllX

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

func (*BalanceSnapshotQuery) Clone

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

func (*BalanceSnapshotQuery) Count

func (bsq *BalanceSnapshotQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*BalanceSnapshotQuery) CountX

func (bsq *BalanceSnapshotQuery) CountX(ctx context.Context) int

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

func (*BalanceSnapshotQuery) Exist

func (bsq *BalanceSnapshotQuery) Exist(ctx context.Context) (bool, error)

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

func (*BalanceSnapshotQuery) ExistX

func (bsq *BalanceSnapshotQuery) ExistX(ctx context.Context) bool

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

func (*BalanceSnapshotQuery) First

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

func (*BalanceSnapshotQuery) FirstID

func (bsq *BalanceSnapshotQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*BalanceSnapshotQuery) FirstIDX

func (bsq *BalanceSnapshotQuery) FirstIDX(ctx context.Context) int

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

func (*BalanceSnapshotQuery) FirstX

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

func (*BalanceSnapshotQuery) ForShare

func (bsq *BalanceSnapshotQuery) ForShare(opts ...sql.LockOption) *BalanceSnapshotQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*BalanceSnapshotQuery) ForUpdate

func (bsq *BalanceSnapshotQuery) ForUpdate(opts ...sql.LockOption) *BalanceSnapshotQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*BalanceSnapshotQuery) GroupBy

func (bsq *BalanceSnapshotQuery) GroupBy(field string, fields ...string) *BalanceSnapshotGroupBy

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 {
	Namespace string `json:"namespace,omitempty"`
	Count int `json:"count,omitempty"`
}

client.BalanceSnapshot.Query().
	GroupBy(balancesnapshot.FieldNamespace).
	Aggregate(db.Count()).
	Scan(ctx, &v)

func (*BalanceSnapshotQuery) IDs

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

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

func (*BalanceSnapshotQuery) IDsX

func (bsq *BalanceSnapshotQuery) IDsX(ctx context.Context) []int

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

func (*BalanceSnapshotQuery) Limit

func (bsq *BalanceSnapshotQuery) Limit(limit int) *BalanceSnapshotQuery

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

func (*BalanceSnapshotQuery) Offset

func (bsq *BalanceSnapshotQuery) Offset(offset int) *BalanceSnapshotQuery

Offset to start from.

func (*BalanceSnapshotQuery) Only

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

func (*BalanceSnapshotQuery) OnlyID

func (bsq *BalanceSnapshotQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*BalanceSnapshotQuery) OnlyIDX

func (bsq *BalanceSnapshotQuery) OnlyIDX(ctx context.Context) int

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

func (*BalanceSnapshotQuery) OnlyX

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

func (*BalanceSnapshotQuery) Order

Order specifies how the records should be ordered.

func (*BalanceSnapshotQuery) Paginate

Paginate runs the query and returns a paginated response. If page is its 0 value then it will return all the items and populate the response page accordingly.

func (*BalanceSnapshotQuery) QueryEntitlement

func (bsq *BalanceSnapshotQuery) QueryEntitlement() *EntitlementQuery

QueryEntitlement chains the current query on the "entitlement" edge.

func (*BalanceSnapshotQuery) Select

func (bsq *BalanceSnapshotQuery) Select(fields ...string) *BalanceSnapshotSelect

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 {
	Namespace string `json:"namespace,omitempty"`
}

client.BalanceSnapshot.Query().
	Select(balancesnapshot.FieldNamespace).
	Scan(ctx, &v)

func (*BalanceSnapshotQuery) Unique

func (bsq *BalanceSnapshotQuery) Unique(unique bool) *BalanceSnapshotQuery

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 (*BalanceSnapshotQuery) Where

Where adds a new predicate for the BalanceSnapshotQuery builder.

func (*BalanceSnapshotQuery) WithEntitlement

func (bsq *BalanceSnapshotQuery) WithEntitlement(opts ...func(*EntitlementQuery)) *BalanceSnapshotQuery

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

type BalanceSnapshotSelect

type BalanceSnapshotSelect struct {
	*BalanceSnapshotQuery
	// contains filtered or unexported fields
}

BalanceSnapshotSelect is the builder for selecting fields of BalanceSnapshot entities.

func (*BalanceSnapshotSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*BalanceSnapshotSelect) Bool

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

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

func (*BalanceSnapshotSelect) BoolX

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

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

func (*BalanceSnapshotSelect) Bools

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

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

func (*BalanceSnapshotSelect) BoolsX

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

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

func (*BalanceSnapshotSelect) Float64

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

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

func (*BalanceSnapshotSelect) Float64X

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

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

func (*BalanceSnapshotSelect) Float64s

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

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

func (*BalanceSnapshotSelect) Float64sX

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

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

func (*BalanceSnapshotSelect) Int

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

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

func (*BalanceSnapshotSelect) IntX

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

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

func (*BalanceSnapshotSelect) Ints

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

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

func (*BalanceSnapshotSelect) IntsX

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

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

func (*BalanceSnapshotSelect) Scan

func (bss *BalanceSnapshotSelect) Scan(ctx context.Context, v any) error

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

func (*BalanceSnapshotSelect) ScanX

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

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

func (*BalanceSnapshotSelect) String

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

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

func (*BalanceSnapshotSelect) StringX

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

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

func (*BalanceSnapshotSelect) Strings

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

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

func (*BalanceSnapshotSelect) StringsX

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

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

type BalanceSnapshotUpdate

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

BalanceSnapshotUpdate is the builder for updating BalanceSnapshot entities.

func (*BalanceSnapshotUpdate) ClearDeletedAt

func (bsu *BalanceSnapshotUpdate) ClearDeletedAt() *BalanceSnapshotUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*BalanceSnapshotUpdate) Exec

func (bsu *BalanceSnapshotUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*BalanceSnapshotUpdate) ExecX

func (bsu *BalanceSnapshotUpdate) ExecX(ctx context.Context)

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

func (*BalanceSnapshotUpdate) Mutation

Mutation returns the BalanceSnapshotMutation object of the builder.

func (*BalanceSnapshotUpdate) Save

func (bsu *BalanceSnapshotUpdate) Save(ctx context.Context) (int, error)

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

func (*BalanceSnapshotUpdate) SaveX

func (bsu *BalanceSnapshotUpdate) SaveX(ctx context.Context) int

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

func (*BalanceSnapshotUpdate) SetDeletedAt

func (bsu *BalanceSnapshotUpdate) SetDeletedAt(t time.Time) *BalanceSnapshotUpdate

SetDeletedAt sets the "deleted_at" field.

func (*BalanceSnapshotUpdate) SetNillableDeletedAt

func (bsu *BalanceSnapshotUpdate) SetNillableDeletedAt(t *time.Time) *BalanceSnapshotUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*BalanceSnapshotUpdate) SetUpdatedAt

func (bsu *BalanceSnapshotUpdate) SetUpdatedAt(t time.Time) *BalanceSnapshotUpdate

SetUpdatedAt sets the "updated_at" field.

func (*BalanceSnapshotUpdate) Where

Where appends a list predicates to the BalanceSnapshotUpdate builder.

type BalanceSnapshotUpdateOne

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

BalanceSnapshotUpdateOne is the builder for updating a single BalanceSnapshot entity.

func (*BalanceSnapshotUpdateOne) ClearDeletedAt

func (bsuo *BalanceSnapshotUpdateOne) ClearDeletedAt() *BalanceSnapshotUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*BalanceSnapshotUpdateOne) Exec

Exec executes the query on the entity.

func (*BalanceSnapshotUpdateOne) ExecX

func (bsuo *BalanceSnapshotUpdateOne) ExecX(ctx context.Context)

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

func (*BalanceSnapshotUpdateOne) Mutation

Mutation returns the BalanceSnapshotMutation object of the builder.

func (*BalanceSnapshotUpdateOne) Save

Save executes the query and returns the updated BalanceSnapshot entity.

func (*BalanceSnapshotUpdateOne) SaveX

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

func (*BalanceSnapshotUpdateOne) Select

func (bsuo *BalanceSnapshotUpdateOne) Select(field string, fields ...string) *BalanceSnapshotUpdateOne

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

func (*BalanceSnapshotUpdateOne) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*BalanceSnapshotUpdateOne) SetNillableDeletedAt

func (bsuo *BalanceSnapshotUpdateOne) SetNillableDeletedAt(t *time.Time) *BalanceSnapshotUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*BalanceSnapshotUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*BalanceSnapshotUpdateOne) Where

Where appends a list predicates to the BalanceSnapshotUpdate builder.

type BalanceSnapshotUpsert

type BalanceSnapshotUpsert struct {
	*sql.UpdateSet
}

BalanceSnapshotUpsert is the "OnConflict" setter.

func (*BalanceSnapshotUpsert) ClearDeletedAt

func (u *BalanceSnapshotUpsert) ClearDeletedAt() *BalanceSnapshotUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*BalanceSnapshotUpsert) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*BalanceSnapshotUpsert) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*BalanceSnapshotUpsert) UpdateDeletedAt

func (u *BalanceSnapshotUpsert) UpdateDeletedAt() *BalanceSnapshotUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*BalanceSnapshotUpsert) UpdateUpdatedAt

func (u *BalanceSnapshotUpsert) UpdateUpdatedAt() *BalanceSnapshotUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type BalanceSnapshotUpsertBulk

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

BalanceSnapshotUpsertBulk is the builder for "upsert"-ing a bulk of BalanceSnapshot nodes.

func (*BalanceSnapshotUpsertBulk) ClearDeletedAt

ClearDeletedAt clears the value of the "deleted_at" field.

func (*BalanceSnapshotUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*BalanceSnapshotUpsertBulk) Exec

Exec executes the query.

func (*BalanceSnapshotUpsertBulk) ExecX

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

func (*BalanceSnapshotUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.BalanceSnapshot.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*BalanceSnapshotUpsertBulk) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*BalanceSnapshotUpsertBulk) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*BalanceSnapshotUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the BalanceSnapshotCreateBulk.OnConflict documentation for more info.

func (*BalanceSnapshotUpsertBulk) UpdateDeletedAt

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*BalanceSnapshotUpsertBulk) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.BalanceSnapshot.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*BalanceSnapshotUpsertBulk) UpdateUpdatedAt

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type BalanceSnapshotUpsertOne

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

BalanceSnapshotUpsertOne is the builder for "upsert"-ing

one BalanceSnapshot node.

func (*BalanceSnapshotUpsertOne) ClearDeletedAt

ClearDeletedAt clears the value of the "deleted_at" field.

func (*BalanceSnapshotUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*BalanceSnapshotUpsertOne) Exec

Exec executes the query.

func (*BalanceSnapshotUpsertOne) ExecX

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

func (*BalanceSnapshotUpsertOne) ID

func (u *BalanceSnapshotUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*BalanceSnapshotUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*BalanceSnapshotUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.BalanceSnapshot.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*BalanceSnapshotUpsertOne) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*BalanceSnapshotUpsertOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*BalanceSnapshotUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the BalanceSnapshotCreate.OnConflict documentation for more info.

func (*BalanceSnapshotUpsertOne) UpdateDeletedAt

func (u *BalanceSnapshotUpsertOne) UpdateDeletedAt() *BalanceSnapshotUpsertOne

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*BalanceSnapshotUpsertOne) UpdateNewValues

func (u *BalanceSnapshotUpsertOne) UpdateNewValues() *BalanceSnapshotUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.BalanceSnapshot.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*BalanceSnapshotUpsertOne) UpdateUpdatedAt

func (u *BalanceSnapshotUpsertOne) UpdateUpdatedAt() *BalanceSnapshotUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type BalanceSnapshots

type BalanceSnapshots []*BalanceSnapshot

BalanceSnapshots is a parsable slice of BalanceSnapshot.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// BalanceSnapshot is the client for interacting with the BalanceSnapshot builders.
	BalanceSnapshot *BalanceSnapshotClient
	// Entitlement is the client for interacting with the Entitlement builders.
	Entitlement *EntitlementClient
	// Feature is the client for interacting with the Feature builders.
	Feature *FeatureClient
	// Grant is the client for interacting with the Grant builders.
	Grant *GrantClient
	// NotificationChannel is the client for interacting with the NotificationChannel builders.
	NotificationChannel *NotificationChannelClient
	// NotificationEvent is the client for interacting with the NotificationEvent builders.
	NotificationEvent *NotificationEventClient
	// NotificationEventDeliveryStatus is the client for interacting with the NotificationEventDeliveryStatus builders.
	NotificationEventDeliveryStatus *NotificationEventDeliveryStatusClient
	// NotificationRule is the client for interacting with the NotificationRule builders.
	NotificationRule *NotificationRuleClient
	// UsageReset is the client for interacting with the UsageReset builders.
	UsageReset *UsageResetClient
	// 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().
	BalanceSnapshot.
	Query().
	Count(ctx)

func (*Client) GetConfig

func (c *Client) GetConfig() *entutils.RawEntConfig

func (*Client) HijackTx

HijackTx returns a new transaction driver with the provided options. The returned transaction can later be used to instanciate new clients.

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 Entitlement

type Entitlement struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// Namespace holds the value of the "namespace" field.
	Namespace string `json:"namespace,omitempty"`
	// Metadata holds the value of the "metadata" field.
	Metadata map[string]string `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"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// EntitlementType holds the value of the "entitlement_type" field.
	EntitlementType entitlement.EntitlementType `json:"entitlement_type,omitempty"`
	// FeatureID holds the value of the "feature_id" field.
	FeatureID string `json:"feature_id,omitempty"`
	// FeatureKey holds the value of the "feature_key" field.
	FeatureKey string `json:"feature_key,omitempty"`
	// SubjectKey holds the value of the "subject_key" field.
	SubjectKey string `json:"subject_key,omitempty"`
	// MeasureUsageFrom holds the value of the "measure_usage_from" field.
	MeasureUsageFrom *time.Time `json:"measure_usage_from,omitempty"`
	// IssueAfterReset holds the value of the "issue_after_reset" field.
	IssueAfterReset *float64 `json:"issue_after_reset,omitempty"`
	// IssueAfterResetPriority holds the value of the "issue_after_reset_priority" field.
	IssueAfterResetPriority *uint8 `json:"issue_after_reset_priority,omitempty"`
	// IsSoftLimit holds the value of the "is_soft_limit" field.
	IsSoftLimit *bool `json:"is_soft_limit,omitempty"`
	// PreserveOverageAtReset holds the value of the "preserve_overage_at_reset" field.
	PreserveOverageAtReset *bool `json:"preserve_overage_at_reset,omitempty"`
	// Config holds the value of the "config" field.
	Config []uint8 `json:"config,omitempty"`
	// UsagePeriodInterval holds the value of the "usage_period_interval" field.
	UsagePeriodInterval *entitlement.UsagePeriodInterval `json:"usage_period_interval,omitempty"`
	// UsagePeriodAnchor holds the value of the "usage_period_anchor" field.
	UsagePeriodAnchor *time.Time `json:"usage_period_anchor,omitempty"`
	// CurrentUsagePeriodStart holds the value of the "current_usage_period_start" field.
	CurrentUsagePeriodStart *time.Time `json:"current_usage_period_start,omitempty"`
	// CurrentUsagePeriodEnd holds the value of the "current_usage_period_end" field.
	CurrentUsagePeriodEnd *time.Time `json:"current_usage_period_end,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the EntitlementQuery when eager-loading is set.
	Edges EntitlementEdges `json:"edges"`
	// contains filtered or unexported fields
}

Entitlement is the model entity for the Entitlement schema.

func (*Entitlement) QueryBalanceSnapshot

func (e *Entitlement) QueryBalanceSnapshot() *BalanceSnapshotQuery

QueryBalanceSnapshot queries the "balance_snapshot" edge of the Entitlement entity.

func (*Entitlement) QueryFeature

func (e *Entitlement) QueryFeature() *FeatureQuery

QueryFeature queries the "feature" edge of the Entitlement entity.

func (*Entitlement) QueryGrant

func (e *Entitlement) QueryGrant() *GrantQuery

QueryGrant queries the "grant" edge of the Entitlement entity.

func (*Entitlement) QueryUsageReset

func (e *Entitlement) QueryUsageReset() *UsageResetQuery

QueryUsageReset queries the "usage_reset" edge of the Entitlement entity.

func (*Entitlement) String

func (e *Entitlement) String() string

String implements the fmt.Stringer.

func (*Entitlement) Unwrap

func (e *Entitlement) Unwrap() *Entitlement

Unwrap unwraps the Entitlement 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 (*Entitlement) Update

func (e *Entitlement) Update() *EntitlementUpdateOne

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

func (*Entitlement) Value

func (e *Entitlement) Value(name string) (ent.Value, error)

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

type EntitlementClient

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

EntitlementClient is a client for the Entitlement schema.

func NewEntitlementClient

func NewEntitlementClient(c config) *EntitlementClient

NewEntitlementClient returns a client for the Entitlement from the given config.

func (*EntitlementClient) Create

func (c *EntitlementClient) Create() *EntitlementCreate

Create returns a builder for creating a Entitlement entity.

func (*EntitlementClient) CreateBulk

func (c *EntitlementClient) CreateBulk(builders ...*EntitlementCreate) *EntitlementCreateBulk

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

func (*EntitlementClient) Delete

func (c *EntitlementClient) Delete() *EntitlementDelete

Delete returns a delete builder for Entitlement.

func (*EntitlementClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*EntitlementClient) DeleteOneID

func (c *EntitlementClient) DeleteOneID(id string) *EntitlementDeleteOne

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

func (*EntitlementClient) Get

Get returns a Entitlement entity by its id.

func (*EntitlementClient) GetX

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

func (*EntitlementClient) Hooks

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

Hooks returns the client hooks.

func (*EntitlementClient) Intercept

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

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

func (*EntitlementClient) Interceptors

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

Interceptors returns the client interceptors.

func (*EntitlementClient) MapCreateBulk

func (c *EntitlementClient) MapCreateBulk(slice any, setFunc func(*EntitlementCreate, int)) *EntitlementCreateBulk

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 (*EntitlementClient) Query

func (c *EntitlementClient) Query() *EntitlementQuery

Query returns a query builder for Entitlement.

func (*EntitlementClient) QueryBalanceSnapshot

func (c *EntitlementClient) QueryBalanceSnapshot(e *Entitlement) *BalanceSnapshotQuery

QueryBalanceSnapshot queries the balance_snapshot edge of a Entitlement.

func (*EntitlementClient) QueryFeature

func (c *EntitlementClient) QueryFeature(e *Entitlement) *FeatureQuery

QueryFeature queries the feature edge of a Entitlement.

func (*EntitlementClient) QueryGrant

func (c *EntitlementClient) QueryGrant(e *Entitlement) *GrantQuery

QueryGrant queries the grant edge of a Entitlement.

func (*EntitlementClient) QueryUsageReset

func (c *EntitlementClient) QueryUsageReset(e *Entitlement) *UsageResetQuery

QueryUsageReset queries the usage_reset edge of a Entitlement.

func (*EntitlementClient) Update

func (c *EntitlementClient) Update() *EntitlementUpdate

Update returns an update builder for Entitlement.

func (*EntitlementClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*EntitlementClient) UpdateOneID

func (c *EntitlementClient) UpdateOneID(id string) *EntitlementUpdateOne

UpdateOneID returns an update builder for the given id.

func (*EntitlementClient) Use

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

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

type EntitlementCreate

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

EntitlementCreate is the builder for creating a Entitlement entity.

func (*EntitlementCreate) AddBalanceSnapshot

func (ec *EntitlementCreate) AddBalanceSnapshot(b ...*BalanceSnapshot) *EntitlementCreate

AddBalanceSnapshot adds the "balance_snapshot" edges to the BalanceSnapshot entity.

func (*EntitlementCreate) AddBalanceSnapshotIDs

func (ec *EntitlementCreate) AddBalanceSnapshotIDs(ids ...int) *EntitlementCreate

AddBalanceSnapshotIDs adds the "balance_snapshot" edge to the BalanceSnapshot entity by IDs.

func (*EntitlementCreate) AddGrant

func (ec *EntitlementCreate) AddGrant(g ...*Grant) *EntitlementCreate

AddGrant adds the "grant" edges to the Grant entity.

func (*EntitlementCreate) AddGrantIDs

func (ec *EntitlementCreate) AddGrantIDs(ids ...string) *EntitlementCreate

AddGrantIDs adds the "grant" edge to the Grant entity by IDs.

func (*EntitlementCreate) AddUsageReset

func (ec *EntitlementCreate) AddUsageReset(u ...*UsageReset) *EntitlementCreate

AddUsageReset adds the "usage_reset" edges to the UsageReset entity.

func (*EntitlementCreate) AddUsageResetIDs

func (ec *EntitlementCreate) AddUsageResetIDs(ids ...string) *EntitlementCreate

AddUsageResetIDs adds the "usage_reset" edge to the UsageReset entity by IDs.

func (*EntitlementCreate) Exec

func (ec *EntitlementCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*EntitlementCreate) ExecX

func (ec *EntitlementCreate) ExecX(ctx context.Context)

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

func (*EntitlementCreate) Mutation

func (ec *EntitlementCreate) Mutation() *EntitlementMutation

Mutation returns the EntitlementMutation object of the builder.

func (*EntitlementCreate) OnConflict

func (ec *EntitlementCreate) OnConflict(opts ...sql.ConflictOption) *EntitlementUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Entitlement.Create().
	SetNamespace(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.EntitlementUpsert) {
		SetNamespace(v+v).
	}).
	Exec(ctx)

func (*EntitlementCreate) OnConflictColumns

func (ec *EntitlementCreate) OnConflictColumns(columns ...string) *EntitlementUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Entitlement.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*EntitlementCreate) Save

Save creates the Entitlement in the database.

func (*EntitlementCreate) SaveX

func (ec *EntitlementCreate) SaveX(ctx context.Context) *Entitlement

SaveX calls Save and panics if Save returns an error.

func (*EntitlementCreate) SetConfig

func (ec *EntitlementCreate) SetConfig(u []uint8) *EntitlementCreate

SetConfig sets the "config" field.

func (*EntitlementCreate) SetCreatedAt

func (ec *EntitlementCreate) SetCreatedAt(t time.Time) *EntitlementCreate

SetCreatedAt sets the "created_at" field.

func (*EntitlementCreate) SetCurrentUsagePeriodEnd

func (ec *EntitlementCreate) SetCurrentUsagePeriodEnd(t time.Time) *EntitlementCreate

SetCurrentUsagePeriodEnd sets the "current_usage_period_end" field.

func (*EntitlementCreate) SetCurrentUsagePeriodStart

func (ec *EntitlementCreate) SetCurrentUsagePeriodStart(t time.Time) *EntitlementCreate

SetCurrentUsagePeriodStart sets the "current_usage_period_start" field.

func (*EntitlementCreate) SetDeletedAt

func (ec *EntitlementCreate) SetDeletedAt(t time.Time) *EntitlementCreate

SetDeletedAt sets the "deleted_at" field.

func (*EntitlementCreate) SetEntitlementType

func (ec *EntitlementCreate) SetEntitlementType(et entitlement.EntitlementType) *EntitlementCreate

SetEntitlementType sets the "entitlement_type" field.

func (*EntitlementCreate) SetFeature

func (ec *EntitlementCreate) SetFeature(f *Feature) *EntitlementCreate

SetFeature sets the "feature" edge to the Feature entity.

func (*EntitlementCreate) SetFeatureID

func (ec *EntitlementCreate) SetFeatureID(s string) *EntitlementCreate

SetFeatureID sets the "feature_id" field.

func (*EntitlementCreate) SetFeatureKey

func (ec *EntitlementCreate) SetFeatureKey(s string) *EntitlementCreate

SetFeatureKey sets the "feature_key" field.

func (*EntitlementCreate) SetID

SetID sets the "id" field.

func (*EntitlementCreate) SetIsSoftLimit

func (ec *EntitlementCreate) SetIsSoftLimit(b bool) *EntitlementCreate

SetIsSoftLimit sets the "is_soft_limit" field.

func (*EntitlementCreate) SetIssueAfterReset

func (ec *EntitlementCreate) SetIssueAfterReset(f float64) *EntitlementCreate

SetIssueAfterReset sets the "issue_after_reset" field.

func (*EntitlementCreate) SetIssueAfterResetPriority

func (ec *EntitlementCreate) SetIssueAfterResetPriority(u uint8) *EntitlementCreate

SetIssueAfterResetPriority sets the "issue_after_reset_priority" field.

func (*EntitlementCreate) SetMeasureUsageFrom

func (ec *EntitlementCreate) SetMeasureUsageFrom(t time.Time) *EntitlementCreate

SetMeasureUsageFrom sets the "measure_usage_from" field.

func (*EntitlementCreate) SetMetadata

func (ec *EntitlementCreate) SetMetadata(m map[string]string) *EntitlementCreate

SetMetadata sets the "metadata" field.

func (*EntitlementCreate) SetNamespace

func (ec *EntitlementCreate) SetNamespace(s string) *EntitlementCreate

SetNamespace sets the "namespace" field.

func (*EntitlementCreate) SetNillableCreatedAt

func (ec *EntitlementCreate) SetNillableCreatedAt(t *time.Time) *EntitlementCreate

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

func (*EntitlementCreate) SetNillableCurrentUsagePeriodEnd

func (ec *EntitlementCreate) SetNillableCurrentUsagePeriodEnd(t *time.Time) *EntitlementCreate

SetNillableCurrentUsagePeriodEnd sets the "current_usage_period_end" field if the given value is not nil.

func (*EntitlementCreate) SetNillableCurrentUsagePeriodStart

func (ec *EntitlementCreate) SetNillableCurrentUsagePeriodStart(t *time.Time) *EntitlementCreate

SetNillableCurrentUsagePeriodStart sets the "current_usage_period_start" field if the given value is not nil.

func (*EntitlementCreate) SetNillableDeletedAt

func (ec *EntitlementCreate) SetNillableDeletedAt(t *time.Time) *EntitlementCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*EntitlementCreate) SetNillableID

func (ec *EntitlementCreate) SetNillableID(s *string) *EntitlementCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*EntitlementCreate) SetNillableIsSoftLimit

func (ec *EntitlementCreate) SetNillableIsSoftLimit(b *bool) *EntitlementCreate

SetNillableIsSoftLimit sets the "is_soft_limit" field if the given value is not nil.

func (*EntitlementCreate) SetNillableIssueAfterReset

func (ec *EntitlementCreate) SetNillableIssueAfterReset(f *float64) *EntitlementCreate

SetNillableIssueAfterReset sets the "issue_after_reset" field if the given value is not nil.

func (*EntitlementCreate) SetNillableIssueAfterResetPriority

func (ec *EntitlementCreate) SetNillableIssueAfterResetPriority(u *uint8) *EntitlementCreate

SetNillableIssueAfterResetPriority sets the "issue_after_reset_priority" field if the given value is not nil.

func (*EntitlementCreate) SetNillableMeasureUsageFrom

func (ec *EntitlementCreate) SetNillableMeasureUsageFrom(t *time.Time) *EntitlementCreate

SetNillableMeasureUsageFrom sets the "measure_usage_from" field if the given value is not nil.

func (*EntitlementCreate) SetNillablePreserveOverageAtReset

func (ec *EntitlementCreate) SetNillablePreserveOverageAtReset(b *bool) *EntitlementCreate

SetNillablePreserveOverageAtReset sets the "preserve_overage_at_reset" field if the given value is not nil.

func (*EntitlementCreate) SetNillableUpdatedAt

func (ec *EntitlementCreate) SetNillableUpdatedAt(t *time.Time) *EntitlementCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*EntitlementCreate) SetNillableUsagePeriodAnchor

func (ec *EntitlementCreate) SetNillableUsagePeriodAnchor(t *time.Time) *EntitlementCreate

SetNillableUsagePeriodAnchor sets the "usage_period_anchor" field if the given value is not nil.

func (*EntitlementCreate) SetNillableUsagePeriodInterval

func (ec *EntitlementCreate) SetNillableUsagePeriodInterval(epi *entitlement.UsagePeriodInterval) *EntitlementCreate

SetNillableUsagePeriodInterval sets the "usage_period_interval" field if the given value is not nil.

func (*EntitlementCreate) SetPreserveOverageAtReset

func (ec *EntitlementCreate) SetPreserveOverageAtReset(b bool) *EntitlementCreate

SetPreserveOverageAtReset sets the "preserve_overage_at_reset" field.

func (*EntitlementCreate) SetSubjectKey

func (ec *EntitlementCreate) SetSubjectKey(s string) *EntitlementCreate

SetSubjectKey sets the "subject_key" field.

func (*EntitlementCreate) SetUpdatedAt

func (ec *EntitlementCreate) SetUpdatedAt(t time.Time) *EntitlementCreate

SetUpdatedAt sets the "updated_at" field.

func (*EntitlementCreate) SetUsagePeriodAnchor

func (ec *EntitlementCreate) SetUsagePeriodAnchor(t time.Time) *EntitlementCreate

SetUsagePeriodAnchor sets the "usage_period_anchor" field.

func (*EntitlementCreate) SetUsagePeriodInterval

func (ec *EntitlementCreate) SetUsagePeriodInterval(epi entitlement.UsagePeriodInterval) *EntitlementCreate

SetUsagePeriodInterval sets the "usage_period_interval" field.

type EntitlementCreateBulk

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

EntitlementCreateBulk is the builder for creating many Entitlement entities in bulk.

func (*EntitlementCreateBulk) Exec

func (ecb *EntitlementCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*EntitlementCreateBulk) ExecX

func (ecb *EntitlementCreateBulk) ExecX(ctx context.Context)

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

func (*EntitlementCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Entitlement.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.EntitlementUpsert) {
		SetNamespace(v+v).
	}).
	Exec(ctx)

func (*EntitlementCreateBulk) OnConflictColumns

func (ecb *EntitlementCreateBulk) OnConflictColumns(columns ...string) *EntitlementUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Entitlement.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*EntitlementCreateBulk) Save

func (ecb *EntitlementCreateBulk) Save(ctx context.Context) ([]*Entitlement, error)

Save creates the Entitlement entities in the database.

func (*EntitlementCreateBulk) SaveX

func (ecb *EntitlementCreateBulk) SaveX(ctx context.Context) []*Entitlement

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

type EntitlementDelete

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

EntitlementDelete is the builder for deleting a Entitlement entity.

func (*EntitlementDelete) Exec

func (ed *EntitlementDelete) Exec(ctx context.Context) (int, error)

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

func (*EntitlementDelete) ExecX

func (ed *EntitlementDelete) ExecX(ctx context.Context) int

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

func (*EntitlementDelete) Where

Where appends a list predicates to the EntitlementDelete builder.

type EntitlementDeleteOne

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

EntitlementDeleteOne is the builder for deleting a single Entitlement entity.

func (*EntitlementDeleteOne) Exec

func (edo *EntitlementDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*EntitlementDeleteOne) ExecX

func (edo *EntitlementDeleteOne) ExecX(ctx context.Context)

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

func (*EntitlementDeleteOne) Where

Where appends a list predicates to the EntitlementDelete builder.

type EntitlementEdges

type EntitlementEdges struct {
	// UsageReset holds the value of the usage_reset edge.
	UsageReset []*UsageReset `json:"usage_reset,omitempty"`
	// Grant holds the value of the grant edge.
	Grant []*Grant `json:"grant,omitempty"`
	// BalanceSnapshot holds the value of the balance_snapshot edge.
	BalanceSnapshot []*BalanceSnapshot `json:"balance_snapshot,omitempty"`
	// Feature holds the value of the feature edge.
	Feature *Feature `json:"feature,omitempty"`
	// contains filtered or unexported fields
}

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

func (EntitlementEdges) BalanceSnapshotOrErr

func (e EntitlementEdges) BalanceSnapshotOrErr() ([]*BalanceSnapshot, error)

BalanceSnapshotOrErr returns the BalanceSnapshot value or an error if the edge was not loaded in eager-loading.

func (EntitlementEdges) FeatureOrErr

func (e EntitlementEdges) FeatureOrErr() (*Feature, error)

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

func (EntitlementEdges) GrantOrErr

func (e EntitlementEdges) GrantOrErr() ([]*Grant, error)

GrantOrErr returns the Grant value or an error if the edge was not loaded in eager-loading.

func (EntitlementEdges) UsageResetOrErr

func (e EntitlementEdges) UsageResetOrErr() ([]*UsageReset, error)

UsageResetOrErr returns the UsageReset value or an error if the edge was not loaded in eager-loading.

type EntitlementGroupBy

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

EntitlementGroupBy is the group-by builder for Entitlement entities.

func (*EntitlementGroupBy) Aggregate

func (egb *EntitlementGroupBy) Aggregate(fns ...AggregateFunc) *EntitlementGroupBy

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

func (*EntitlementGroupBy) Bool

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

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

func (*EntitlementGroupBy) BoolX

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

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

func (*EntitlementGroupBy) Bools

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

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

func (*EntitlementGroupBy) BoolsX

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

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

func (*EntitlementGroupBy) Float64

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

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

func (*EntitlementGroupBy) Float64X

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

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

func (*EntitlementGroupBy) Float64s

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

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

func (*EntitlementGroupBy) Float64sX

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

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

func (*EntitlementGroupBy) Int

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

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

func (*EntitlementGroupBy) IntX

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

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

func (*EntitlementGroupBy) Ints

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

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

func (*EntitlementGroupBy) IntsX

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

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

func (*EntitlementGroupBy) Scan

func (egb *EntitlementGroupBy) Scan(ctx context.Context, v any) error

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

func (*EntitlementGroupBy) ScanX

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

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

func (*EntitlementGroupBy) String

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

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

func (*EntitlementGroupBy) StringX

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

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

func (*EntitlementGroupBy) Strings

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

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

func (*EntitlementGroupBy) StringsX

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

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

type EntitlementMutation

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

EntitlementMutation represents an operation that mutates the Entitlement nodes in the graph.

func (*EntitlementMutation) AddBalanceSnapshotIDs

func (m *EntitlementMutation) AddBalanceSnapshotIDs(ids ...int)

AddBalanceSnapshotIDs adds the "balance_snapshot" edge to the BalanceSnapshot entity by ids.

func (*EntitlementMutation) AddField

func (m *EntitlementMutation) 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 (*EntitlementMutation) AddGrantIDs

func (m *EntitlementMutation) AddGrantIDs(ids ...string)

AddGrantIDs adds the "grant" edge to the Grant entity by ids.

func (*EntitlementMutation) AddIssueAfterReset

func (m *EntitlementMutation) AddIssueAfterReset(f float64)

AddIssueAfterReset adds f to the "issue_after_reset" field.

func (*EntitlementMutation) AddIssueAfterResetPriority

func (m *EntitlementMutation) AddIssueAfterResetPriority(u int8)

AddIssueAfterResetPriority adds u to the "issue_after_reset_priority" field.

func (*EntitlementMutation) AddUsageResetIDs

func (m *EntitlementMutation) AddUsageResetIDs(ids ...string)

AddUsageResetIDs adds the "usage_reset" edge to the UsageReset entity by ids.

func (*EntitlementMutation) AddedEdges

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

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

func (*EntitlementMutation) AddedField

func (m *EntitlementMutation) 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 (*EntitlementMutation) AddedFields

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

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

func (*EntitlementMutation) AddedIDs

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

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

func (*EntitlementMutation) AddedIssueAfterReset

func (m *EntitlementMutation) AddedIssueAfterReset() (r float64, exists bool)

AddedIssueAfterReset returns the value that was added to the "issue_after_reset" field in this mutation.

func (*EntitlementMutation) AddedIssueAfterResetPriority

func (m *EntitlementMutation) AddedIssueAfterResetPriority() (r int8, exists bool)

AddedIssueAfterResetPriority returns the value that was added to the "issue_after_reset_priority" field in this mutation.

func (*EntitlementMutation) AppendConfig

func (m *EntitlementMutation) AppendConfig(u []uint8)

AppendConfig adds u to the "config" field.

func (*EntitlementMutation) AppendedConfig

func (m *EntitlementMutation) AppendedConfig() ([]uint8, bool)

AppendedConfig returns the list of values that were appended to the "config" field in this mutation.

func (*EntitlementMutation) BalanceSnapshotCleared

func (m *EntitlementMutation) BalanceSnapshotCleared() bool

BalanceSnapshotCleared reports if the "balance_snapshot" edge to the BalanceSnapshot entity was cleared.

func (*EntitlementMutation) BalanceSnapshotIDs

func (m *EntitlementMutation) BalanceSnapshotIDs() (ids []int)

BalanceSnapshotIDs returns the "balance_snapshot" edge IDs in the mutation.

func (*EntitlementMutation) ClearBalanceSnapshot

func (m *EntitlementMutation) ClearBalanceSnapshot()

ClearBalanceSnapshot clears the "balance_snapshot" edge to the BalanceSnapshot entity.

func (*EntitlementMutation) ClearConfig

func (m *EntitlementMutation) ClearConfig()

ClearConfig clears the value of the "config" field.

func (*EntitlementMutation) ClearCurrentUsagePeriodEnd

func (m *EntitlementMutation) ClearCurrentUsagePeriodEnd()

ClearCurrentUsagePeriodEnd clears the value of the "current_usage_period_end" field.

func (*EntitlementMutation) ClearCurrentUsagePeriodStart

func (m *EntitlementMutation) ClearCurrentUsagePeriodStart()

ClearCurrentUsagePeriodStart clears the value of the "current_usage_period_start" field.

func (*EntitlementMutation) ClearDeletedAt

func (m *EntitlementMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*EntitlementMutation) ClearEdge

func (m *EntitlementMutation) 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 (*EntitlementMutation) ClearFeature

func (m *EntitlementMutation) ClearFeature()

ClearFeature clears the "feature" edge to the Feature entity.

func (*EntitlementMutation) ClearField

func (m *EntitlementMutation) 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 (*EntitlementMutation) ClearGrant

func (m *EntitlementMutation) ClearGrant()

ClearGrant clears the "grant" edge to the Grant entity.

func (*EntitlementMutation) ClearIsSoftLimit

func (m *EntitlementMutation) ClearIsSoftLimit()

ClearIsSoftLimit clears the value of the "is_soft_limit" field.

func (*EntitlementMutation) ClearIssueAfterReset

func (m *EntitlementMutation) ClearIssueAfterReset()

ClearIssueAfterReset clears the value of the "issue_after_reset" field.

func (*EntitlementMutation) ClearIssueAfterResetPriority

func (m *EntitlementMutation) ClearIssueAfterResetPriority()

ClearIssueAfterResetPriority clears the value of the "issue_after_reset_priority" field.

func (*EntitlementMutation) ClearMeasureUsageFrom

func (m *EntitlementMutation) ClearMeasureUsageFrom()

ClearMeasureUsageFrom clears the value of the "measure_usage_from" field.

func (*EntitlementMutation) ClearMetadata

func (m *EntitlementMutation) ClearMetadata()

ClearMetadata clears the value of the "metadata" field.

func (*EntitlementMutation) ClearPreserveOverageAtReset

func (m *EntitlementMutation) ClearPreserveOverageAtReset()

ClearPreserveOverageAtReset clears the value of the "preserve_overage_at_reset" field.

func (*EntitlementMutation) ClearUsagePeriodAnchor

func (m *EntitlementMutation) ClearUsagePeriodAnchor()

ClearUsagePeriodAnchor clears the value of the "usage_period_anchor" field.

func (*EntitlementMutation) ClearUsagePeriodInterval

func (m *EntitlementMutation) ClearUsagePeriodInterval()

ClearUsagePeriodInterval clears the value of the "usage_period_interval" field.

func (*EntitlementMutation) ClearUsageReset

func (m *EntitlementMutation) ClearUsageReset()

ClearUsageReset clears the "usage_reset" edge to the UsageReset entity.

func (*EntitlementMutation) ClearedEdges

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

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

func (*EntitlementMutation) ClearedFields

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

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

func (EntitlementMutation) Client

func (m EntitlementMutation) 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 (*EntitlementMutation) Config

func (m *EntitlementMutation) Config() (r []uint8, exists bool)

Config returns the value of the "config" field in the mutation.

func (*EntitlementMutation) ConfigCleared

func (m *EntitlementMutation) ConfigCleared() bool

ConfigCleared returns if the "config" field was cleared in this mutation.

func (*EntitlementMutation) CreatedAt

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

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

func (*EntitlementMutation) CurrentUsagePeriodEnd

func (m *EntitlementMutation) CurrentUsagePeriodEnd() (r time.Time, exists bool)

CurrentUsagePeriodEnd returns the value of the "current_usage_period_end" field in the mutation.

func (*EntitlementMutation) CurrentUsagePeriodEndCleared

func (m *EntitlementMutation) CurrentUsagePeriodEndCleared() bool

CurrentUsagePeriodEndCleared returns if the "current_usage_period_end" field was cleared in this mutation.

func (*EntitlementMutation) CurrentUsagePeriodStart

func (m *EntitlementMutation) CurrentUsagePeriodStart() (r time.Time, exists bool)

CurrentUsagePeriodStart returns the value of the "current_usage_period_start" field in the mutation.

func (*EntitlementMutation) CurrentUsagePeriodStartCleared

func (m *EntitlementMutation) CurrentUsagePeriodStartCleared() bool

CurrentUsagePeriodStartCleared returns if the "current_usage_period_start" field was cleared in this mutation.

func (*EntitlementMutation) DeletedAt

func (m *EntitlementMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*EntitlementMutation) DeletedAtCleared

func (m *EntitlementMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*EntitlementMutation) EdgeCleared

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

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

func (*EntitlementMutation) EntitlementType

func (m *EntitlementMutation) EntitlementType() (r entitlement.EntitlementType, exists bool)

EntitlementType returns the value of the "entitlement_type" field in the mutation.

func (*EntitlementMutation) FeatureCleared

func (m *EntitlementMutation) FeatureCleared() bool

FeatureCleared reports if the "feature" edge to the Feature entity was cleared.

func (*EntitlementMutation) FeatureID

func (m *EntitlementMutation) FeatureID() (r string, exists bool)

FeatureID returns the value of the "feature_id" field in the mutation.

func (*EntitlementMutation) FeatureIDs

func (m *EntitlementMutation) FeatureIDs() (ids []string)

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

func (*EntitlementMutation) FeatureKey

func (m *EntitlementMutation) FeatureKey() (r string, exists bool)

FeatureKey returns the value of the "feature_key" field in the mutation.

func (*EntitlementMutation) Field

func (m *EntitlementMutation) 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 (*EntitlementMutation) FieldCleared

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

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

func (*EntitlementMutation) Fields

func (m *EntitlementMutation) 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 (*EntitlementMutation) GrantCleared

func (m *EntitlementMutation) GrantCleared() bool

GrantCleared reports if the "grant" edge to the Grant entity was cleared.

func (*EntitlementMutation) GrantIDs

func (m *EntitlementMutation) GrantIDs() (ids []string)

GrantIDs returns the "grant" edge IDs in the mutation.

func (*EntitlementMutation) ID

func (m *EntitlementMutation) ID() (id string, 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 (*EntitlementMutation) IDs

func (m *EntitlementMutation) IDs(ctx context.Context) ([]string, 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 (*EntitlementMutation) IsSoftLimit

func (m *EntitlementMutation) IsSoftLimit() (r bool, exists bool)

IsSoftLimit returns the value of the "is_soft_limit" field in the mutation.

func (*EntitlementMutation) IsSoftLimitCleared

func (m *EntitlementMutation) IsSoftLimitCleared() bool

IsSoftLimitCleared returns if the "is_soft_limit" field was cleared in this mutation.

func (*EntitlementMutation) IssueAfterReset

func (m *EntitlementMutation) IssueAfterReset() (r float64, exists bool)

IssueAfterReset returns the value of the "issue_after_reset" field in the mutation.

func (*EntitlementMutation) IssueAfterResetCleared

func (m *EntitlementMutation) IssueAfterResetCleared() bool

IssueAfterResetCleared returns if the "issue_after_reset" field was cleared in this mutation.

func (*EntitlementMutation) IssueAfterResetPriority

func (m *EntitlementMutation) IssueAfterResetPriority() (r uint8, exists bool)

IssueAfterResetPriority returns the value of the "issue_after_reset_priority" field in the mutation.

func (*EntitlementMutation) IssueAfterResetPriorityCleared

func (m *EntitlementMutation) IssueAfterResetPriorityCleared() bool

IssueAfterResetPriorityCleared returns if the "issue_after_reset_priority" field was cleared in this mutation.

func (*EntitlementMutation) MeasureUsageFrom

func (m *EntitlementMutation) MeasureUsageFrom() (r time.Time, exists bool)

MeasureUsageFrom returns the value of the "measure_usage_from" field in the mutation.

func (*EntitlementMutation) MeasureUsageFromCleared

func (m *EntitlementMutation) MeasureUsageFromCleared() bool

MeasureUsageFromCleared returns if the "measure_usage_from" field was cleared in this mutation.

func (*EntitlementMutation) Metadata

func (m *EntitlementMutation) Metadata() (r map[string]string, exists bool)

Metadata returns the value of the "metadata" field in the mutation.

func (*EntitlementMutation) MetadataCleared

func (m *EntitlementMutation) MetadataCleared() bool

MetadataCleared returns if the "metadata" field was cleared in this mutation.

func (*EntitlementMutation) Namespace

func (m *EntitlementMutation) Namespace() (r string, exists bool)

Namespace returns the value of the "namespace" field in the mutation.

func (*EntitlementMutation) OldConfig

func (m *EntitlementMutation) OldConfig(ctx context.Context) (v []uint8, err error)

OldConfig returns the old "config" field's value of the Entitlement entity. If the Entitlement 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 (*EntitlementMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the Entitlement entity. If the Entitlement 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 (*EntitlementMutation) OldCurrentUsagePeriodEnd

func (m *EntitlementMutation) OldCurrentUsagePeriodEnd(ctx context.Context) (v *time.Time, err error)

OldCurrentUsagePeriodEnd returns the old "current_usage_period_end" field's value of the Entitlement entity. If the Entitlement 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 (*EntitlementMutation) OldCurrentUsagePeriodStart

func (m *EntitlementMutation) OldCurrentUsagePeriodStart(ctx context.Context) (v *time.Time, err error)

OldCurrentUsagePeriodStart returns the old "current_usage_period_start" field's value of the Entitlement entity. If the Entitlement 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 (*EntitlementMutation) OldDeletedAt

func (m *EntitlementMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Entitlement entity. If the Entitlement 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 (*EntitlementMutation) OldEntitlementType

func (m *EntitlementMutation) OldEntitlementType(ctx context.Context) (v entitlement.EntitlementType, err error)

OldEntitlementType returns the old "entitlement_type" field's value of the Entitlement entity. If the Entitlement 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 (*EntitlementMutation) OldFeatureID

func (m *EntitlementMutation) OldFeatureID(ctx context.Context) (v string, err error)

OldFeatureID returns the old "feature_id" field's value of the Entitlement entity. If the Entitlement 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 (*EntitlementMutation) OldFeatureKey

func (m *EntitlementMutation) OldFeatureKey(ctx context.Context) (v string, err error)

OldFeatureKey returns the old "feature_key" field's value of the Entitlement entity. If the Entitlement 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 (*EntitlementMutation) OldField

func (m *EntitlementMutation) 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 (*EntitlementMutation) OldIsSoftLimit

func (m *EntitlementMutation) OldIsSoftLimit(ctx context.Context) (v *bool, err error)

OldIsSoftLimit returns the old "is_soft_limit" field's value of the Entitlement entity. If the Entitlement 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 (*EntitlementMutation) OldIssueAfterReset

func (m *EntitlementMutation) OldIssueAfterReset(ctx context.Context) (v *float64, err error)

OldIssueAfterReset returns the old "issue_after_reset" field's value of the Entitlement entity. If the Entitlement 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 (*EntitlementMutation) OldIssueAfterResetPriority

func (m *EntitlementMutation) OldIssueAfterResetPriority(ctx context.Context) (v *uint8, err error)

OldIssueAfterResetPriority returns the old "issue_after_reset_priority" field's value of the Entitlement entity. If the Entitlement 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 (*EntitlementMutation) OldMeasureUsageFrom

func (m *EntitlementMutation) OldMeasureUsageFrom(ctx context.Context) (v *time.Time, err error)

OldMeasureUsageFrom returns the old "measure_usage_from" field's value of the Entitlement entity. If the Entitlement 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 (*EntitlementMutation) OldMetadata

func (m *EntitlementMutation) OldMetadata(ctx context.Context) (v map[string]string, err error)

OldMetadata returns the old "metadata" field's value of the Entitlement entity. If the Entitlement 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 (*EntitlementMutation) OldNamespace

func (m *EntitlementMutation) OldNamespace(ctx context.Context) (v string, err error)

OldNamespace returns the old "namespace" field's value of the Entitlement entity. If the Entitlement 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 (*EntitlementMutation) OldPreserveOverageAtReset

func (m *EntitlementMutation) OldPreserveOverageAtReset(ctx context.Context) (v *bool, err error)

OldPreserveOverageAtReset returns the old "preserve_overage_at_reset" field's value of the Entitlement entity. If the Entitlement 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 (*EntitlementMutation) OldSubjectKey

func (m *EntitlementMutation) OldSubjectKey(ctx context.Context) (v string, err error)

OldSubjectKey returns the old "subject_key" field's value of the Entitlement entity. If the Entitlement 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 (*EntitlementMutation) OldUpdatedAt

func (m *EntitlementMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Entitlement entity. If the Entitlement 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 (*EntitlementMutation) OldUsagePeriodAnchor

func (m *EntitlementMutation) OldUsagePeriodAnchor(ctx context.Context) (v *time.Time, err error)

OldUsagePeriodAnchor returns the old "usage_period_anchor" field's value of the Entitlement entity. If the Entitlement 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 (*EntitlementMutation) OldUsagePeriodInterval

func (m *EntitlementMutation) OldUsagePeriodInterval(ctx context.Context) (v *entitlement.UsagePeriodInterval, err error)

OldUsagePeriodInterval returns the old "usage_period_interval" field's value of the Entitlement entity. If the Entitlement 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 (*EntitlementMutation) Op

func (m *EntitlementMutation) Op() Op

Op returns the operation name.

func (*EntitlementMutation) PreserveOverageAtReset

func (m *EntitlementMutation) PreserveOverageAtReset() (r bool, exists bool)

PreserveOverageAtReset returns the value of the "preserve_overage_at_reset" field in the mutation.

func (*EntitlementMutation) PreserveOverageAtResetCleared

func (m *EntitlementMutation) PreserveOverageAtResetCleared() bool

PreserveOverageAtResetCleared returns if the "preserve_overage_at_reset" field was cleared in this mutation.

func (*EntitlementMutation) RemoveBalanceSnapshotIDs

func (m *EntitlementMutation) RemoveBalanceSnapshotIDs(ids ...int)

RemoveBalanceSnapshotIDs removes the "balance_snapshot" edge to the BalanceSnapshot entity by IDs.

func (*EntitlementMutation) RemoveGrantIDs

func (m *EntitlementMutation) RemoveGrantIDs(ids ...string)

RemoveGrantIDs removes the "grant" edge to the Grant entity by IDs.

func (*EntitlementMutation) RemoveUsageResetIDs

func (m *EntitlementMutation) RemoveUsageResetIDs(ids ...string)

RemoveUsageResetIDs removes the "usage_reset" edge to the UsageReset entity by IDs.

func (*EntitlementMutation) RemovedBalanceSnapshotIDs

func (m *EntitlementMutation) RemovedBalanceSnapshotIDs() (ids []int)

RemovedBalanceSnapshot returns the removed IDs of the "balance_snapshot" edge to the BalanceSnapshot entity.

func (*EntitlementMutation) RemovedEdges

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

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

func (*EntitlementMutation) RemovedGrantIDs

func (m *EntitlementMutation) RemovedGrantIDs() (ids []string)

RemovedGrant returns the removed IDs of the "grant" edge to the Grant entity.

func (*EntitlementMutation) RemovedIDs

func (m *EntitlementMutation) 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 (*EntitlementMutation) RemovedUsageResetIDs

func (m *EntitlementMutation) RemovedUsageResetIDs() (ids []string)

RemovedUsageReset returns the removed IDs of the "usage_reset" edge to the UsageReset entity.

func (*EntitlementMutation) ResetBalanceSnapshot

func (m *EntitlementMutation) ResetBalanceSnapshot()

ResetBalanceSnapshot resets all changes to the "balance_snapshot" edge.

func (*EntitlementMutation) ResetConfig

func (m *EntitlementMutation) ResetConfig()

ResetConfig resets all changes to the "config" field.

func (*EntitlementMutation) ResetCreatedAt

func (m *EntitlementMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*EntitlementMutation) ResetCurrentUsagePeriodEnd

func (m *EntitlementMutation) ResetCurrentUsagePeriodEnd()

ResetCurrentUsagePeriodEnd resets all changes to the "current_usage_period_end" field.

func (*EntitlementMutation) ResetCurrentUsagePeriodStart

func (m *EntitlementMutation) ResetCurrentUsagePeriodStart()

ResetCurrentUsagePeriodStart resets all changes to the "current_usage_period_start" field.

func (*EntitlementMutation) ResetDeletedAt

func (m *EntitlementMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*EntitlementMutation) ResetEdge

func (m *EntitlementMutation) 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 (*EntitlementMutation) ResetEntitlementType

func (m *EntitlementMutation) ResetEntitlementType()

ResetEntitlementType resets all changes to the "entitlement_type" field.

func (*EntitlementMutation) ResetFeature

func (m *EntitlementMutation) ResetFeature()

ResetFeature resets all changes to the "feature" edge.

func (*EntitlementMutation) ResetFeatureID

func (m *EntitlementMutation) ResetFeatureID()

ResetFeatureID resets all changes to the "feature_id" field.

func (*EntitlementMutation) ResetFeatureKey

func (m *EntitlementMutation) ResetFeatureKey()

ResetFeatureKey resets all changes to the "feature_key" field.

func (*EntitlementMutation) ResetField

func (m *EntitlementMutation) 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 (*EntitlementMutation) ResetGrant

func (m *EntitlementMutation) ResetGrant()

ResetGrant resets all changes to the "grant" edge.

func (*EntitlementMutation) ResetIsSoftLimit

func (m *EntitlementMutation) ResetIsSoftLimit()

ResetIsSoftLimit resets all changes to the "is_soft_limit" field.

func (*EntitlementMutation) ResetIssueAfterReset

func (m *EntitlementMutation) ResetIssueAfterReset()

ResetIssueAfterReset resets all changes to the "issue_after_reset" field.

func (*EntitlementMutation) ResetIssueAfterResetPriority

func (m *EntitlementMutation) ResetIssueAfterResetPriority()

ResetIssueAfterResetPriority resets all changes to the "issue_after_reset_priority" field.

func (*EntitlementMutation) ResetMeasureUsageFrom

func (m *EntitlementMutation) ResetMeasureUsageFrom()

ResetMeasureUsageFrom resets all changes to the "measure_usage_from" field.

func (*EntitlementMutation) ResetMetadata

func (m *EntitlementMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" field.

func (*EntitlementMutation) ResetNamespace

func (m *EntitlementMutation) ResetNamespace()

ResetNamespace resets all changes to the "namespace" field.

func (*EntitlementMutation) ResetPreserveOverageAtReset

func (m *EntitlementMutation) ResetPreserveOverageAtReset()

ResetPreserveOverageAtReset resets all changes to the "preserve_overage_at_reset" field.

func (*EntitlementMutation) ResetSubjectKey

func (m *EntitlementMutation) ResetSubjectKey()

ResetSubjectKey resets all changes to the "subject_key" field.

func (*EntitlementMutation) ResetUpdatedAt

func (m *EntitlementMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*EntitlementMutation) ResetUsagePeriodAnchor

func (m *EntitlementMutation) ResetUsagePeriodAnchor()

ResetUsagePeriodAnchor resets all changes to the "usage_period_anchor" field.

func (*EntitlementMutation) ResetUsagePeriodInterval

func (m *EntitlementMutation) ResetUsagePeriodInterval()

ResetUsagePeriodInterval resets all changes to the "usage_period_interval" field.

func (*EntitlementMutation) ResetUsageReset

func (m *EntitlementMutation) ResetUsageReset()

ResetUsageReset resets all changes to the "usage_reset" edge.

func (*EntitlementMutation) SetConfig

func (m *EntitlementMutation) SetConfig(u []uint8)

SetConfig sets the "config" field.

func (*EntitlementMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*EntitlementMutation) SetCurrentUsagePeriodEnd

func (m *EntitlementMutation) SetCurrentUsagePeriodEnd(t time.Time)

SetCurrentUsagePeriodEnd sets the "current_usage_period_end" field.

func (*EntitlementMutation) SetCurrentUsagePeriodStart

func (m *EntitlementMutation) SetCurrentUsagePeriodStart(t time.Time)

SetCurrentUsagePeriodStart sets the "current_usage_period_start" field.

func (*EntitlementMutation) SetDeletedAt

func (m *EntitlementMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*EntitlementMutation) SetEntitlementType

func (m *EntitlementMutation) SetEntitlementType(et entitlement.EntitlementType)

SetEntitlementType sets the "entitlement_type" field.

func (*EntitlementMutation) SetFeatureID

func (m *EntitlementMutation) SetFeatureID(s string)

SetFeatureID sets the "feature_id" field.

func (*EntitlementMutation) SetFeatureKey

func (m *EntitlementMutation) SetFeatureKey(s string)

SetFeatureKey sets the "feature_key" field.

func (*EntitlementMutation) SetField

func (m *EntitlementMutation) 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 (*EntitlementMutation) SetID

func (m *EntitlementMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Entitlement entities.

func (*EntitlementMutation) SetIsSoftLimit

func (m *EntitlementMutation) SetIsSoftLimit(b bool)

SetIsSoftLimit sets the "is_soft_limit" field.

func (*EntitlementMutation) SetIssueAfterReset

func (m *EntitlementMutation) SetIssueAfterReset(f float64)

SetIssueAfterReset sets the "issue_after_reset" field.

func (*EntitlementMutation) SetIssueAfterResetPriority

func (m *EntitlementMutation) SetIssueAfterResetPriority(u uint8)

SetIssueAfterResetPriority sets the "issue_after_reset_priority" field.

func (*EntitlementMutation) SetMeasureUsageFrom

func (m *EntitlementMutation) SetMeasureUsageFrom(t time.Time)

SetMeasureUsageFrom sets the "measure_usage_from" field.

func (*EntitlementMutation) SetMetadata

func (m *EntitlementMutation) SetMetadata(value map[string]string)

SetMetadata sets the "metadata" field.

func (*EntitlementMutation) SetNamespace

func (m *EntitlementMutation) SetNamespace(s string)

SetNamespace sets the "namespace" field.

func (*EntitlementMutation) SetOp

func (m *EntitlementMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*EntitlementMutation) SetPreserveOverageAtReset

func (m *EntitlementMutation) SetPreserveOverageAtReset(b bool)

SetPreserveOverageAtReset sets the "preserve_overage_at_reset" field.

func (*EntitlementMutation) SetSubjectKey

func (m *EntitlementMutation) SetSubjectKey(s string)

SetSubjectKey sets the "subject_key" field.

func (*EntitlementMutation) SetUpdatedAt

func (m *EntitlementMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*EntitlementMutation) SetUsagePeriodAnchor

func (m *EntitlementMutation) SetUsagePeriodAnchor(t time.Time)

SetUsagePeriodAnchor sets the "usage_period_anchor" field.

func (*EntitlementMutation) SetUsagePeriodInterval

func (m *EntitlementMutation) SetUsagePeriodInterval(epi entitlement.UsagePeriodInterval)

SetUsagePeriodInterval sets the "usage_period_interval" field.

func (*EntitlementMutation) SubjectKey

func (m *EntitlementMutation) SubjectKey() (r string, exists bool)

SubjectKey returns the value of the "subject_key" field in the mutation.

func (EntitlementMutation) Tx

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

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

func (*EntitlementMutation) Type

func (m *EntitlementMutation) Type() string

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

func (*EntitlementMutation) UpdatedAt

func (m *EntitlementMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*EntitlementMutation) UsagePeriodAnchor

func (m *EntitlementMutation) UsagePeriodAnchor() (r time.Time, exists bool)

UsagePeriodAnchor returns the value of the "usage_period_anchor" field in the mutation.

func (*EntitlementMutation) UsagePeriodAnchorCleared

func (m *EntitlementMutation) UsagePeriodAnchorCleared() bool

UsagePeriodAnchorCleared returns if the "usage_period_anchor" field was cleared in this mutation.

func (*EntitlementMutation) UsagePeriodInterval

func (m *EntitlementMutation) UsagePeriodInterval() (r entitlement.UsagePeriodInterval, exists bool)

UsagePeriodInterval returns the value of the "usage_period_interval" field in the mutation.

func (*EntitlementMutation) UsagePeriodIntervalCleared

func (m *EntitlementMutation) UsagePeriodIntervalCleared() bool

UsagePeriodIntervalCleared returns if the "usage_period_interval" field was cleared in this mutation.

func (*EntitlementMutation) UsageResetCleared

func (m *EntitlementMutation) UsageResetCleared() bool

UsageResetCleared reports if the "usage_reset" edge to the UsageReset entity was cleared.

func (*EntitlementMutation) UsageResetIDs

func (m *EntitlementMutation) UsageResetIDs() (ids []string)

UsageResetIDs returns the "usage_reset" edge IDs in the mutation.

func (*EntitlementMutation) Where

func (m *EntitlementMutation) Where(ps ...predicate.Entitlement)

Where appends a list predicates to the EntitlementMutation builder.

func (*EntitlementMutation) WhereP

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

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

type EntitlementQuery

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

EntitlementQuery is the builder for querying Entitlement entities.

func (*EntitlementQuery) Aggregate

func (eq *EntitlementQuery) Aggregate(fns ...AggregateFunc) *EntitlementSelect

Aggregate returns a EntitlementSelect configured with the given aggregations.

func (*EntitlementQuery) All

func (eq *EntitlementQuery) All(ctx context.Context) ([]*Entitlement, error)

All executes the query and returns a list of Entitlements.

func (*EntitlementQuery) AllX

func (eq *EntitlementQuery) AllX(ctx context.Context) []*Entitlement

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

func (*EntitlementQuery) Clone

func (eq *EntitlementQuery) Clone() *EntitlementQuery

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

func (*EntitlementQuery) Count

func (eq *EntitlementQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*EntitlementQuery) CountX

func (eq *EntitlementQuery) CountX(ctx context.Context) int

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

func (*EntitlementQuery) Exist

func (eq *EntitlementQuery) Exist(ctx context.Context) (bool, error)

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

func (*EntitlementQuery) ExistX

func (eq *EntitlementQuery) ExistX(ctx context.Context) bool

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

func (*EntitlementQuery) First

func (eq *EntitlementQuery) First(ctx context.Context) (*Entitlement, error)

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

func (*EntitlementQuery) FirstID

func (eq *EntitlementQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*EntitlementQuery) FirstIDX

func (eq *EntitlementQuery) FirstIDX(ctx context.Context) string

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

func (*EntitlementQuery) FirstX

func (eq *EntitlementQuery) FirstX(ctx context.Context) *Entitlement

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

func (*EntitlementQuery) ForShare

func (eq *EntitlementQuery) ForShare(opts ...sql.LockOption) *EntitlementQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*EntitlementQuery) ForUpdate

func (eq *EntitlementQuery) ForUpdate(opts ...sql.LockOption) *EntitlementQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*EntitlementQuery) GroupBy

func (eq *EntitlementQuery) GroupBy(field string, fields ...string) *EntitlementGroupBy

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 {
	Namespace string `json:"namespace,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Entitlement.Query().
	GroupBy(entitlement.FieldNamespace).
	Aggregate(db.Count()).
	Scan(ctx, &v)

func (*EntitlementQuery) IDs

func (eq *EntitlementQuery) IDs(ctx context.Context) (ids []string, err error)

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

func (*EntitlementQuery) IDsX

func (eq *EntitlementQuery) IDsX(ctx context.Context) []string

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

func (*EntitlementQuery) Limit

func (eq *EntitlementQuery) Limit(limit int) *EntitlementQuery

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

func (*EntitlementQuery) Offset

func (eq *EntitlementQuery) Offset(offset int) *EntitlementQuery

Offset to start from.

func (*EntitlementQuery) Only

func (eq *EntitlementQuery) Only(ctx context.Context) (*Entitlement, error)

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

func (*EntitlementQuery) OnlyID

func (eq *EntitlementQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*EntitlementQuery) OnlyIDX

func (eq *EntitlementQuery) OnlyIDX(ctx context.Context) string

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

func (*EntitlementQuery) OnlyX

func (eq *EntitlementQuery) OnlyX(ctx context.Context) *Entitlement

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

func (*EntitlementQuery) Order

Order specifies how the records should be ordered.

func (*EntitlementQuery) Paginate

Paginate runs the query and returns a paginated response. If page is its 0 value then it will return all the items and populate the response page accordingly.

func (*EntitlementQuery) QueryBalanceSnapshot

func (eq *EntitlementQuery) QueryBalanceSnapshot() *BalanceSnapshotQuery

QueryBalanceSnapshot chains the current query on the "balance_snapshot" edge.

func (*EntitlementQuery) QueryFeature

func (eq *EntitlementQuery) QueryFeature() *FeatureQuery

QueryFeature chains the current query on the "feature" edge.

func (*EntitlementQuery) QueryGrant

func (eq *EntitlementQuery) QueryGrant() *GrantQuery

QueryGrant chains the current query on the "grant" edge.

func (*EntitlementQuery) QueryUsageReset

func (eq *EntitlementQuery) QueryUsageReset() *UsageResetQuery

QueryUsageReset chains the current query on the "usage_reset" edge.

func (*EntitlementQuery) Select

func (eq *EntitlementQuery) Select(fields ...string) *EntitlementSelect

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 {
	Namespace string `json:"namespace,omitempty"`
}

client.Entitlement.Query().
	Select(entitlement.FieldNamespace).
	Scan(ctx, &v)

func (*EntitlementQuery) Unique

func (eq *EntitlementQuery) Unique(unique bool) *EntitlementQuery

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 (*EntitlementQuery) Where

Where adds a new predicate for the EntitlementQuery builder.

func (*EntitlementQuery) WithBalanceSnapshot

func (eq *EntitlementQuery) WithBalanceSnapshot(opts ...func(*BalanceSnapshotQuery)) *EntitlementQuery

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

func (*EntitlementQuery) WithFeature

func (eq *EntitlementQuery) WithFeature(opts ...func(*FeatureQuery)) *EntitlementQuery

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

func (*EntitlementQuery) WithGrant

func (eq *EntitlementQuery) WithGrant(opts ...func(*GrantQuery)) *EntitlementQuery

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

func (*EntitlementQuery) WithUsageReset

func (eq *EntitlementQuery) WithUsageReset(opts ...func(*UsageResetQuery)) *EntitlementQuery

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

type EntitlementSelect

type EntitlementSelect struct {
	*EntitlementQuery
	// contains filtered or unexported fields
}

EntitlementSelect is the builder for selecting fields of Entitlement entities.

func (*EntitlementSelect) Aggregate

func (es *EntitlementSelect) Aggregate(fns ...AggregateFunc) *EntitlementSelect

Aggregate adds the given aggregation functions to the selector query.

func (*EntitlementSelect) Bool

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

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

func (*EntitlementSelect) BoolX

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

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

func (*EntitlementSelect) Bools

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

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

func (*EntitlementSelect) BoolsX

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

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

func (*EntitlementSelect) Float64

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

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

func (*EntitlementSelect) Float64X

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

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

func (*EntitlementSelect) Float64s

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

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

func (*EntitlementSelect) Float64sX

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

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

func (*EntitlementSelect) Int

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

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

func (*EntitlementSelect) IntX

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

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

func (*EntitlementSelect) Ints

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

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

func (*EntitlementSelect) IntsX

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

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

func (*EntitlementSelect) Scan

func (es *EntitlementSelect) Scan(ctx context.Context, v any) error

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

func (*EntitlementSelect) ScanX

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

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

func (*EntitlementSelect) String

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

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

func (*EntitlementSelect) StringX

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

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

func (*EntitlementSelect) Strings

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

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

func (*EntitlementSelect) StringsX

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

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

type EntitlementUpdate

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

EntitlementUpdate is the builder for updating Entitlement entities.

func (*EntitlementUpdate) AddBalanceSnapshot

func (eu *EntitlementUpdate) AddBalanceSnapshot(b ...*BalanceSnapshot) *EntitlementUpdate

AddBalanceSnapshot adds the "balance_snapshot" edges to the BalanceSnapshot entity.

func (*EntitlementUpdate) AddBalanceSnapshotIDs

func (eu *EntitlementUpdate) AddBalanceSnapshotIDs(ids ...int) *EntitlementUpdate

AddBalanceSnapshotIDs adds the "balance_snapshot" edge to the BalanceSnapshot entity by IDs.

func (*EntitlementUpdate) AddGrant

func (eu *EntitlementUpdate) AddGrant(g ...*Grant) *EntitlementUpdate

AddGrant adds the "grant" edges to the Grant entity.

func (*EntitlementUpdate) AddGrantIDs

func (eu *EntitlementUpdate) AddGrantIDs(ids ...string) *EntitlementUpdate

AddGrantIDs adds the "grant" edge to the Grant entity by IDs.

func (*EntitlementUpdate) AddUsageReset

func (eu *EntitlementUpdate) AddUsageReset(u ...*UsageReset) *EntitlementUpdate

AddUsageReset adds the "usage_reset" edges to the UsageReset entity.

func (*EntitlementUpdate) AddUsageResetIDs

func (eu *EntitlementUpdate) AddUsageResetIDs(ids ...string) *EntitlementUpdate

AddUsageResetIDs adds the "usage_reset" edge to the UsageReset entity by IDs.

func (*EntitlementUpdate) AppendConfig

func (eu *EntitlementUpdate) AppendConfig(u []uint8) *EntitlementUpdate

AppendConfig appends u to the "config" field.

func (*EntitlementUpdate) ClearBalanceSnapshot

func (eu *EntitlementUpdate) ClearBalanceSnapshot() *EntitlementUpdate

ClearBalanceSnapshot clears all "balance_snapshot" edges to the BalanceSnapshot entity.

func (*EntitlementUpdate) ClearConfig

func (eu *EntitlementUpdate) ClearConfig() *EntitlementUpdate

ClearConfig clears the value of the "config" field.

func (*EntitlementUpdate) ClearCurrentUsagePeriodEnd

func (eu *EntitlementUpdate) ClearCurrentUsagePeriodEnd() *EntitlementUpdate

ClearCurrentUsagePeriodEnd clears the value of the "current_usage_period_end" field.

func (*EntitlementUpdate) ClearCurrentUsagePeriodStart

func (eu *EntitlementUpdate) ClearCurrentUsagePeriodStart() *EntitlementUpdate

ClearCurrentUsagePeriodStart clears the value of the "current_usage_period_start" field.

func (*EntitlementUpdate) ClearDeletedAt

func (eu *EntitlementUpdate) ClearDeletedAt() *EntitlementUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*EntitlementUpdate) ClearGrant

func (eu *EntitlementUpdate) ClearGrant() *EntitlementUpdate

ClearGrant clears all "grant" edges to the Grant entity.

func (*EntitlementUpdate) ClearMetadata

func (eu *EntitlementUpdate) ClearMetadata() *EntitlementUpdate

ClearMetadata clears the value of the "metadata" field.

func (*EntitlementUpdate) ClearUsagePeriodAnchor

func (eu *EntitlementUpdate) ClearUsagePeriodAnchor() *EntitlementUpdate

ClearUsagePeriodAnchor clears the value of the "usage_period_anchor" field.

func (*EntitlementUpdate) ClearUsageReset

func (eu *EntitlementUpdate) ClearUsageReset() *EntitlementUpdate

ClearUsageReset clears all "usage_reset" edges to the UsageReset entity.

func (*EntitlementUpdate) Exec

func (eu *EntitlementUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*EntitlementUpdate) ExecX

func (eu *EntitlementUpdate) ExecX(ctx context.Context)

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

func (*EntitlementUpdate) Mutation

func (eu *EntitlementUpdate) Mutation() *EntitlementMutation

Mutation returns the EntitlementMutation object of the builder.

func (*EntitlementUpdate) RemoveBalanceSnapshot

func (eu *EntitlementUpdate) RemoveBalanceSnapshot(b ...*BalanceSnapshot) *EntitlementUpdate

RemoveBalanceSnapshot removes "balance_snapshot" edges to BalanceSnapshot entities.

func (*EntitlementUpdate) RemoveBalanceSnapshotIDs

func (eu *EntitlementUpdate) RemoveBalanceSnapshotIDs(ids ...int) *EntitlementUpdate

RemoveBalanceSnapshotIDs removes the "balance_snapshot" edge to BalanceSnapshot entities by IDs.

func (*EntitlementUpdate) RemoveGrant

func (eu *EntitlementUpdate) RemoveGrant(g ...*Grant) *EntitlementUpdate

RemoveGrant removes "grant" edges to Grant entities.

func (*EntitlementUpdate) RemoveGrantIDs

func (eu *EntitlementUpdate) RemoveGrantIDs(ids ...string) *EntitlementUpdate

RemoveGrantIDs removes the "grant" edge to Grant entities by IDs.

func (*EntitlementUpdate) RemoveUsageReset

func (eu *EntitlementUpdate) RemoveUsageReset(u ...*UsageReset) *EntitlementUpdate

RemoveUsageReset removes "usage_reset" edges to UsageReset entities.

func (*EntitlementUpdate) RemoveUsageResetIDs

func (eu *EntitlementUpdate) RemoveUsageResetIDs(ids ...string) *EntitlementUpdate

RemoveUsageResetIDs removes the "usage_reset" edge to UsageReset entities by IDs.

func (*EntitlementUpdate) Save

func (eu *EntitlementUpdate) Save(ctx context.Context) (int, error)

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

func (*EntitlementUpdate) SaveX

func (eu *EntitlementUpdate) SaveX(ctx context.Context) int

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

func (*EntitlementUpdate) SetConfig

func (eu *EntitlementUpdate) SetConfig(u []uint8) *EntitlementUpdate

SetConfig sets the "config" field.

func (*EntitlementUpdate) SetCurrentUsagePeriodEnd

func (eu *EntitlementUpdate) SetCurrentUsagePeriodEnd(t time.Time) *EntitlementUpdate

SetCurrentUsagePeriodEnd sets the "current_usage_period_end" field.

func (*EntitlementUpdate) SetCurrentUsagePeriodStart

func (eu *EntitlementUpdate) SetCurrentUsagePeriodStart(t time.Time) *EntitlementUpdate

SetCurrentUsagePeriodStart sets the "current_usage_period_start" field.

func (*EntitlementUpdate) SetDeletedAt

func (eu *EntitlementUpdate) SetDeletedAt(t time.Time) *EntitlementUpdate

SetDeletedAt sets the "deleted_at" field.

func (*EntitlementUpdate) SetMetadata

func (eu *EntitlementUpdate) SetMetadata(m map[string]string) *EntitlementUpdate

SetMetadata sets the "metadata" field.

func (*EntitlementUpdate) SetNillableCurrentUsagePeriodEnd

func (eu *EntitlementUpdate) SetNillableCurrentUsagePeriodEnd(t *time.Time) *EntitlementUpdate

SetNillableCurrentUsagePeriodEnd sets the "current_usage_period_end" field if the given value is not nil.

func (*EntitlementUpdate) SetNillableCurrentUsagePeriodStart

func (eu *EntitlementUpdate) SetNillableCurrentUsagePeriodStart(t *time.Time) *EntitlementUpdate

SetNillableCurrentUsagePeriodStart sets the "current_usage_period_start" field if the given value is not nil.

func (*EntitlementUpdate) SetNillableDeletedAt

func (eu *EntitlementUpdate) SetNillableDeletedAt(t *time.Time) *EntitlementUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*EntitlementUpdate) SetNillableUsagePeriodAnchor

func (eu *EntitlementUpdate) SetNillableUsagePeriodAnchor(t *time.Time) *EntitlementUpdate

SetNillableUsagePeriodAnchor sets the "usage_period_anchor" field if the given value is not nil.

func (*EntitlementUpdate) SetUpdatedAt

func (eu *EntitlementUpdate) SetUpdatedAt(t time.Time) *EntitlementUpdate

SetUpdatedAt sets the "updated_at" field.

func (*EntitlementUpdate) SetUsagePeriodAnchor

func (eu *EntitlementUpdate) SetUsagePeriodAnchor(t time.Time) *EntitlementUpdate

SetUsagePeriodAnchor sets the "usage_period_anchor" field.

func (*EntitlementUpdate) Where

Where appends a list predicates to the EntitlementUpdate builder.

type EntitlementUpdateOne

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

EntitlementUpdateOne is the builder for updating a single Entitlement entity.

func (*EntitlementUpdateOne) AddBalanceSnapshot

func (euo *EntitlementUpdateOne) AddBalanceSnapshot(b ...*BalanceSnapshot) *EntitlementUpdateOne

AddBalanceSnapshot adds the "balance_snapshot" edges to the BalanceSnapshot entity.

func (*EntitlementUpdateOne) AddBalanceSnapshotIDs

func (euo *EntitlementUpdateOne) AddBalanceSnapshotIDs(ids ...int) *EntitlementUpdateOne

AddBalanceSnapshotIDs adds the "balance_snapshot" edge to the BalanceSnapshot entity by IDs.

func (*EntitlementUpdateOne) AddGrant

func (euo *EntitlementUpdateOne) AddGrant(g ...*Grant) *EntitlementUpdateOne

AddGrant adds the "grant" edges to the Grant entity.

func (*EntitlementUpdateOne) AddGrantIDs

func (euo *EntitlementUpdateOne) AddGrantIDs(ids ...string) *EntitlementUpdateOne

AddGrantIDs adds the "grant" edge to the Grant entity by IDs.

func (*EntitlementUpdateOne) AddUsageReset

func (euo *EntitlementUpdateOne) AddUsageReset(u ...*UsageReset) *EntitlementUpdateOne

AddUsageReset adds the "usage_reset" edges to the UsageReset entity.

func (*EntitlementUpdateOne) AddUsageResetIDs

func (euo *EntitlementUpdateOne) AddUsageResetIDs(ids ...string) *EntitlementUpdateOne

AddUsageResetIDs adds the "usage_reset" edge to the UsageReset entity by IDs.

func (*EntitlementUpdateOne) AppendConfig

func (euo *EntitlementUpdateOne) AppendConfig(u []uint8) *EntitlementUpdateOne

AppendConfig appends u to the "config" field.

func (*EntitlementUpdateOne) ClearBalanceSnapshot

func (euo *EntitlementUpdateOne) ClearBalanceSnapshot() *EntitlementUpdateOne

ClearBalanceSnapshot clears all "balance_snapshot" edges to the BalanceSnapshot entity.

func (*EntitlementUpdateOne) ClearConfig

func (euo *EntitlementUpdateOne) ClearConfig() *EntitlementUpdateOne

ClearConfig clears the value of the "config" field.

func (*EntitlementUpdateOne) ClearCurrentUsagePeriodEnd

func (euo *EntitlementUpdateOne) ClearCurrentUsagePeriodEnd() *EntitlementUpdateOne

ClearCurrentUsagePeriodEnd clears the value of the "current_usage_period_end" field.

func (*EntitlementUpdateOne) ClearCurrentUsagePeriodStart

func (euo *EntitlementUpdateOne) ClearCurrentUsagePeriodStart() *EntitlementUpdateOne

ClearCurrentUsagePeriodStart clears the value of the "current_usage_period_start" field.

func (*EntitlementUpdateOne) ClearDeletedAt

func (euo *EntitlementUpdateOne) ClearDeletedAt() *EntitlementUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*EntitlementUpdateOne) ClearGrant

func (euo *EntitlementUpdateOne) ClearGrant() *EntitlementUpdateOne

ClearGrant clears all "grant" edges to the Grant entity.

func (*EntitlementUpdateOne) ClearMetadata

func (euo *EntitlementUpdateOne) ClearMetadata() *EntitlementUpdateOne

ClearMetadata clears the value of the "metadata" field.

func (*EntitlementUpdateOne) ClearUsagePeriodAnchor

func (euo *EntitlementUpdateOne) ClearUsagePeriodAnchor() *EntitlementUpdateOne

ClearUsagePeriodAnchor clears the value of the "usage_period_anchor" field.

func (*EntitlementUpdateOne) ClearUsageReset

func (euo *EntitlementUpdateOne) ClearUsageReset() *EntitlementUpdateOne

ClearUsageReset clears all "usage_reset" edges to the UsageReset entity.

func (*EntitlementUpdateOne) Exec

func (euo *EntitlementUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*EntitlementUpdateOne) ExecX

func (euo *EntitlementUpdateOne) ExecX(ctx context.Context)

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

func (*EntitlementUpdateOne) Mutation

func (euo *EntitlementUpdateOne) Mutation() *EntitlementMutation

Mutation returns the EntitlementMutation object of the builder.

func (*EntitlementUpdateOne) RemoveBalanceSnapshot

func (euo *EntitlementUpdateOne) RemoveBalanceSnapshot(b ...*BalanceSnapshot) *EntitlementUpdateOne

RemoveBalanceSnapshot removes "balance_snapshot" edges to BalanceSnapshot entities.

func (*EntitlementUpdateOne) RemoveBalanceSnapshotIDs

func (euo *EntitlementUpdateOne) RemoveBalanceSnapshotIDs(ids ...int) *EntitlementUpdateOne

RemoveBalanceSnapshotIDs removes the "balance_snapshot" edge to BalanceSnapshot entities by IDs.

func (*EntitlementUpdateOne) RemoveGrant

func (euo *EntitlementUpdateOne) RemoveGrant(g ...*Grant) *EntitlementUpdateOne

RemoveGrant removes "grant" edges to Grant entities.

func (*EntitlementUpdateOne) RemoveGrantIDs

func (euo *EntitlementUpdateOne) RemoveGrantIDs(ids ...string) *EntitlementUpdateOne

RemoveGrantIDs removes the "grant" edge to Grant entities by IDs.

func (*EntitlementUpdateOne) RemoveUsageReset

func (euo *EntitlementUpdateOne) RemoveUsageReset(u ...*UsageReset) *EntitlementUpdateOne

RemoveUsageReset removes "usage_reset" edges to UsageReset entities.

func (*EntitlementUpdateOne) RemoveUsageResetIDs

func (euo *EntitlementUpdateOne) RemoveUsageResetIDs(ids ...string) *EntitlementUpdateOne

RemoveUsageResetIDs removes the "usage_reset" edge to UsageReset entities by IDs.

func (*EntitlementUpdateOne) Save

Save executes the query and returns the updated Entitlement entity.

func (*EntitlementUpdateOne) SaveX

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

func (*EntitlementUpdateOne) Select

func (euo *EntitlementUpdateOne) Select(field string, fields ...string) *EntitlementUpdateOne

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

func (*EntitlementUpdateOne) SetConfig

func (euo *EntitlementUpdateOne) SetConfig(u []uint8) *EntitlementUpdateOne

SetConfig sets the "config" field.

func (*EntitlementUpdateOne) SetCurrentUsagePeriodEnd

func (euo *EntitlementUpdateOne) SetCurrentUsagePeriodEnd(t time.Time) *EntitlementUpdateOne

SetCurrentUsagePeriodEnd sets the "current_usage_period_end" field.

func (*EntitlementUpdateOne) SetCurrentUsagePeriodStart

func (euo *EntitlementUpdateOne) SetCurrentUsagePeriodStart(t time.Time) *EntitlementUpdateOne

SetCurrentUsagePeriodStart sets the "current_usage_period_start" field.

func (*EntitlementUpdateOne) SetDeletedAt

func (euo *EntitlementUpdateOne) SetDeletedAt(t time.Time) *EntitlementUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*EntitlementUpdateOne) SetMetadata

func (euo *EntitlementUpdateOne) SetMetadata(m map[string]string) *EntitlementUpdateOne

SetMetadata sets the "metadata" field.

func (*EntitlementUpdateOne) SetNillableCurrentUsagePeriodEnd

func (euo *EntitlementUpdateOne) SetNillableCurrentUsagePeriodEnd(t *time.Time) *EntitlementUpdateOne

SetNillableCurrentUsagePeriodEnd sets the "current_usage_period_end" field if the given value is not nil.

func (*EntitlementUpdateOne) SetNillableCurrentUsagePeriodStart

func (euo *EntitlementUpdateOne) SetNillableCurrentUsagePeriodStart(t *time.Time) *EntitlementUpdateOne

SetNillableCurrentUsagePeriodStart sets the "current_usage_period_start" field if the given value is not nil.

func (*EntitlementUpdateOne) SetNillableDeletedAt

func (euo *EntitlementUpdateOne) SetNillableDeletedAt(t *time.Time) *EntitlementUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*EntitlementUpdateOne) SetNillableUsagePeriodAnchor

func (euo *EntitlementUpdateOne) SetNillableUsagePeriodAnchor(t *time.Time) *EntitlementUpdateOne

SetNillableUsagePeriodAnchor sets the "usage_period_anchor" field if the given value is not nil.

func (*EntitlementUpdateOne) SetUpdatedAt

func (euo *EntitlementUpdateOne) SetUpdatedAt(t time.Time) *EntitlementUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*EntitlementUpdateOne) SetUsagePeriodAnchor

func (euo *EntitlementUpdateOne) SetUsagePeriodAnchor(t time.Time) *EntitlementUpdateOne

SetUsagePeriodAnchor sets the "usage_period_anchor" field.

func (*EntitlementUpdateOne) Where

Where appends a list predicates to the EntitlementUpdate builder.

type EntitlementUpsert

type EntitlementUpsert struct {
	*sql.UpdateSet
}

EntitlementUpsert is the "OnConflict" setter.

func (*EntitlementUpsert) ClearConfig

func (u *EntitlementUpsert) ClearConfig() *EntitlementUpsert

ClearConfig clears the value of the "config" field.

func (*EntitlementUpsert) ClearCurrentUsagePeriodEnd

func (u *EntitlementUpsert) ClearCurrentUsagePeriodEnd() *EntitlementUpsert

ClearCurrentUsagePeriodEnd clears the value of the "current_usage_period_end" field.

func (*EntitlementUpsert) ClearCurrentUsagePeriodStart

func (u *EntitlementUpsert) ClearCurrentUsagePeriodStart() *EntitlementUpsert

ClearCurrentUsagePeriodStart clears the value of the "current_usage_period_start" field.

func (*EntitlementUpsert) ClearDeletedAt

func (u *EntitlementUpsert) ClearDeletedAt() *EntitlementUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*EntitlementUpsert) ClearMetadata

func (u *EntitlementUpsert) ClearMetadata() *EntitlementUpsert

ClearMetadata clears the value of the "metadata" field.

func (*EntitlementUpsert) ClearUsagePeriodAnchor

func (u *EntitlementUpsert) ClearUsagePeriodAnchor() *EntitlementUpsert

ClearUsagePeriodAnchor clears the value of the "usage_period_anchor" field.

func (*EntitlementUpsert) SetConfig

func (u *EntitlementUpsert) SetConfig(v []uint8) *EntitlementUpsert

SetConfig sets the "config" field.

func (*EntitlementUpsert) SetCurrentUsagePeriodEnd

func (u *EntitlementUpsert) SetCurrentUsagePeriodEnd(v time.Time) *EntitlementUpsert

SetCurrentUsagePeriodEnd sets the "current_usage_period_end" field.

func (*EntitlementUpsert) SetCurrentUsagePeriodStart

func (u *EntitlementUpsert) SetCurrentUsagePeriodStart(v time.Time) *EntitlementUpsert

SetCurrentUsagePeriodStart sets the "current_usage_period_start" field.

func (*EntitlementUpsert) SetDeletedAt

func (u *EntitlementUpsert) SetDeletedAt(v time.Time) *EntitlementUpsert

SetDeletedAt sets the "deleted_at" field.

func (*EntitlementUpsert) SetMetadata

func (u *EntitlementUpsert) SetMetadata(v map[string]string) *EntitlementUpsert

SetMetadata sets the "metadata" field.

func (*EntitlementUpsert) SetUpdatedAt

func (u *EntitlementUpsert) SetUpdatedAt(v time.Time) *EntitlementUpsert

SetUpdatedAt sets the "updated_at" field.

func (*EntitlementUpsert) SetUsagePeriodAnchor

func (u *EntitlementUpsert) SetUsagePeriodAnchor(v time.Time) *EntitlementUpsert

SetUsagePeriodAnchor sets the "usage_period_anchor" field.

func (*EntitlementUpsert) UpdateConfig

func (u *EntitlementUpsert) UpdateConfig() *EntitlementUpsert

UpdateConfig sets the "config" field to the value that was provided on create.

func (*EntitlementUpsert) UpdateCurrentUsagePeriodEnd

func (u *EntitlementUpsert) UpdateCurrentUsagePeriodEnd() *EntitlementUpsert

UpdateCurrentUsagePeriodEnd sets the "current_usage_period_end" field to the value that was provided on create.

func (*EntitlementUpsert) UpdateCurrentUsagePeriodStart

func (u *EntitlementUpsert) UpdateCurrentUsagePeriodStart() *EntitlementUpsert

UpdateCurrentUsagePeriodStart sets the "current_usage_period_start" field to the value that was provided on create.

func (*EntitlementUpsert) UpdateDeletedAt

func (u *EntitlementUpsert) UpdateDeletedAt() *EntitlementUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*EntitlementUpsert) UpdateMetadata

func (u *EntitlementUpsert) UpdateMetadata() *EntitlementUpsert

UpdateMetadata sets the "metadata" field to the value that was provided on create.

func (*EntitlementUpsert) UpdateUpdatedAt

func (u *EntitlementUpsert) UpdateUpdatedAt() *EntitlementUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*EntitlementUpsert) UpdateUsagePeriodAnchor

func (u *EntitlementUpsert) UpdateUsagePeriodAnchor() *EntitlementUpsert

UpdateUsagePeriodAnchor sets the "usage_period_anchor" field to the value that was provided on create.

type EntitlementUpsertBulk

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

EntitlementUpsertBulk is the builder for "upsert"-ing a bulk of Entitlement nodes.

func (*EntitlementUpsertBulk) ClearConfig

func (u *EntitlementUpsertBulk) ClearConfig() *EntitlementUpsertBulk

ClearConfig clears the value of the "config" field.

func (*EntitlementUpsertBulk) ClearCurrentUsagePeriodEnd

func (u *EntitlementUpsertBulk) ClearCurrentUsagePeriodEnd() *EntitlementUpsertBulk

ClearCurrentUsagePeriodEnd clears the value of the "current_usage_period_end" field.

func (*EntitlementUpsertBulk) ClearCurrentUsagePeriodStart

func (u *EntitlementUpsertBulk) ClearCurrentUsagePeriodStart() *EntitlementUpsertBulk

ClearCurrentUsagePeriodStart clears the value of the "current_usage_period_start" field.

func (*EntitlementUpsertBulk) ClearDeletedAt

func (u *EntitlementUpsertBulk) ClearDeletedAt() *EntitlementUpsertBulk

ClearDeletedAt clears the value of the "deleted_at" field.

func (*EntitlementUpsertBulk) ClearMetadata

func (u *EntitlementUpsertBulk) ClearMetadata() *EntitlementUpsertBulk

ClearMetadata clears the value of the "metadata" field.

func (*EntitlementUpsertBulk) ClearUsagePeriodAnchor

func (u *EntitlementUpsertBulk) ClearUsagePeriodAnchor() *EntitlementUpsertBulk

ClearUsagePeriodAnchor clears the value of the "usage_period_anchor" field.

func (*EntitlementUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*EntitlementUpsertBulk) Exec

Exec executes the query.

func (*EntitlementUpsertBulk) ExecX

func (u *EntitlementUpsertBulk) ExecX(ctx context.Context)

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

func (*EntitlementUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Entitlement.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*EntitlementUpsertBulk) SetConfig

SetConfig sets the "config" field.

func (*EntitlementUpsertBulk) SetCurrentUsagePeriodEnd

func (u *EntitlementUpsertBulk) SetCurrentUsagePeriodEnd(v time.Time) *EntitlementUpsertBulk

SetCurrentUsagePeriodEnd sets the "current_usage_period_end" field.

func (*EntitlementUpsertBulk) SetCurrentUsagePeriodStart

func (u *EntitlementUpsertBulk) SetCurrentUsagePeriodStart(v time.Time) *EntitlementUpsertBulk

SetCurrentUsagePeriodStart sets the "current_usage_period_start" field.

func (*EntitlementUpsertBulk) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*EntitlementUpsertBulk) SetMetadata

SetMetadata sets the "metadata" field.

func (*EntitlementUpsertBulk) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*EntitlementUpsertBulk) SetUsagePeriodAnchor

func (u *EntitlementUpsertBulk) SetUsagePeriodAnchor(v time.Time) *EntitlementUpsertBulk

SetUsagePeriodAnchor sets the "usage_period_anchor" field.

func (*EntitlementUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the EntitlementCreateBulk.OnConflict documentation for more info.

func (*EntitlementUpsertBulk) UpdateConfig

func (u *EntitlementUpsertBulk) UpdateConfig() *EntitlementUpsertBulk

UpdateConfig sets the "config" field to the value that was provided on create.

func (*EntitlementUpsertBulk) UpdateCurrentUsagePeriodEnd

func (u *EntitlementUpsertBulk) UpdateCurrentUsagePeriodEnd() *EntitlementUpsertBulk

UpdateCurrentUsagePeriodEnd sets the "current_usage_period_end" field to the value that was provided on create.

func (*EntitlementUpsertBulk) UpdateCurrentUsagePeriodStart

func (u *EntitlementUpsertBulk) UpdateCurrentUsagePeriodStart() *EntitlementUpsertBulk

UpdateCurrentUsagePeriodStart sets the "current_usage_period_start" field to the value that was provided on create.

func (*EntitlementUpsertBulk) UpdateDeletedAt

func (u *EntitlementUpsertBulk) UpdateDeletedAt() *EntitlementUpsertBulk

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*EntitlementUpsertBulk) UpdateMetadata

func (u *EntitlementUpsertBulk) UpdateMetadata() *EntitlementUpsertBulk

UpdateMetadata sets the "metadata" field to the value that was provided on create.

func (*EntitlementUpsertBulk) UpdateNewValues

func (u *EntitlementUpsertBulk) UpdateNewValues() *EntitlementUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Entitlement.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(entitlement.FieldID)
		}),
	).
	Exec(ctx)

func (*EntitlementUpsertBulk) UpdateUpdatedAt

func (u *EntitlementUpsertBulk) UpdateUpdatedAt() *EntitlementUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*EntitlementUpsertBulk) UpdateUsagePeriodAnchor

func (u *EntitlementUpsertBulk) UpdateUsagePeriodAnchor() *EntitlementUpsertBulk

UpdateUsagePeriodAnchor sets the "usage_period_anchor" field to the value that was provided on create.

type EntitlementUpsertOne

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

EntitlementUpsertOne is the builder for "upsert"-ing

one Entitlement node.

func (*EntitlementUpsertOne) ClearConfig

func (u *EntitlementUpsertOne) ClearConfig() *EntitlementUpsertOne

ClearConfig clears the value of the "config" field.

func (*EntitlementUpsertOne) ClearCurrentUsagePeriodEnd

func (u *EntitlementUpsertOne) ClearCurrentUsagePeriodEnd() *EntitlementUpsertOne

ClearCurrentUsagePeriodEnd clears the value of the "current_usage_period_end" field.

func (*EntitlementUpsertOne) ClearCurrentUsagePeriodStart

func (u *EntitlementUpsertOne) ClearCurrentUsagePeriodStart() *EntitlementUpsertOne

ClearCurrentUsagePeriodStart clears the value of the "current_usage_period_start" field.

func (*EntitlementUpsertOne) ClearDeletedAt

func (u *EntitlementUpsertOne) ClearDeletedAt() *EntitlementUpsertOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*EntitlementUpsertOne) ClearMetadata

func (u *EntitlementUpsertOne) ClearMetadata() *EntitlementUpsertOne

ClearMetadata clears the value of the "metadata" field.

func (*EntitlementUpsertOne) ClearUsagePeriodAnchor

func (u *EntitlementUpsertOne) ClearUsagePeriodAnchor() *EntitlementUpsertOne

ClearUsagePeriodAnchor clears the value of the "usage_period_anchor" field.

func (*EntitlementUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*EntitlementUpsertOne) Exec

Exec executes the query.

func (*EntitlementUpsertOne) ExecX

func (u *EntitlementUpsertOne) ExecX(ctx context.Context)

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

func (*EntitlementUpsertOne) ID

func (u *EntitlementUpsertOne) ID(ctx context.Context) (id string, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*EntitlementUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*EntitlementUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Entitlement.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*EntitlementUpsertOne) SetConfig

func (u *EntitlementUpsertOne) SetConfig(v []uint8) *EntitlementUpsertOne

SetConfig sets the "config" field.

func (*EntitlementUpsertOne) SetCurrentUsagePeriodEnd

func (u *EntitlementUpsertOne) SetCurrentUsagePeriodEnd(v time.Time) *EntitlementUpsertOne

SetCurrentUsagePeriodEnd sets the "current_usage_period_end" field.

func (*EntitlementUpsertOne) SetCurrentUsagePeriodStart

func (u *EntitlementUpsertOne) SetCurrentUsagePeriodStart(v time.Time) *EntitlementUpsertOne

SetCurrentUsagePeriodStart sets the "current_usage_period_start" field.

func (*EntitlementUpsertOne) SetDeletedAt

func (u *EntitlementUpsertOne) SetDeletedAt(v time.Time) *EntitlementUpsertOne

SetDeletedAt sets the "deleted_at" field.

func (*EntitlementUpsertOne) SetMetadata

func (u *EntitlementUpsertOne) SetMetadata(v map[string]string) *EntitlementUpsertOne

SetMetadata sets the "metadata" field.

func (*EntitlementUpsertOne) SetUpdatedAt

func (u *EntitlementUpsertOne) SetUpdatedAt(v time.Time) *EntitlementUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*EntitlementUpsertOne) SetUsagePeriodAnchor

func (u *EntitlementUpsertOne) SetUsagePeriodAnchor(v time.Time) *EntitlementUpsertOne

SetUsagePeriodAnchor sets the "usage_period_anchor" field.

func (*EntitlementUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the EntitlementCreate.OnConflict documentation for more info.

func (*EntitlementUpsertOne) UpdateConfig

func (u *EntitlementUpsertOne) UpdateConfig() *EntitlementUpsertOne

UpdateConfig sets the "config" field to the value that was provided on create.

func (*EntitlementUpsertOne) UpdateCurrentUsagePeriodEnd

func (u *EntitlementUpsertOne) UpdateCurrentUsagePeriodEnd() *EntitlementUpsertOne

UpdateCurrentUsagePeriodEnd sets the "current_usage_period_end" field to the value that was provided on create.

func (*EntitlementUpsertOne) UpdateCurrentUsagePeriodStart

func (u *EntitlementUpsertOne) UpdateCurrentUsagePeriodStart() *EntitlementUpsertOne

UpdateCurrentUsagePeriodStart sets the "current_usage_period_start" field to the value that was provided on create.

func (*EntitlementUpsertOne) UpdateDeletedAt

func (u *EntitlementUpsertOne) UpdateDeletedAt() *EntitlementUpsertOne

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*EntitlementUpsertOne) UpdateMetadata

func (u *EntitlementUpsertOne) UpdateMetadata() *EntitlementUpsertOne

UpdateMetadata sets the "metadata" field to the value that was provided on create.

func (*EntitlementUpsertOne) UpdateNewValues

func (u *EntitlementUpsertOne) UpdateNewValues() *EntitlementUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Entitlement.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(entitlement.FieldID)
		}),
	).
	Exec(ctx)

func (*EntitlementUpsertOne) UpdateUpdatedAt

func (u *EntitlementUpsertOne) UpdateUpdatedAt() *EntitlementUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*EntitlementUpsertOne) UpdateUsagePeriodAnchor

func (u *EntitlementUpsertOne) UpdateUsagePeriodAnchor() *EntitlementUpsertOne

UpdateUsagePeriodAnchor sets the "usage_period_anchor" field to the value that was provided on create.

type Entitlements

type Entitlements []*Entitlement

Entitlements is a parsable slice of Entitlement.

type ExposedTxDriver

type ExposedTxDriver struct {
	Driver *txDriver
}

func (*ExposedTxDriver) Commit

func (d *ExposedTxDriver) Commit() error

ignores hooks

func (*ExposedTxDriver) Rollback

func (d *ExposedTxDriver) Rollback() error

ignores hooks

type Feature

type Feature struct {

	// ID of the ent.
	ID string `json:"id,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"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// Metadata holds the value of the "metadata" field.
	Metadata map[string]string `json:"metadata,omitempty"`
	// Namespace holds the value of the "namespace" field.
	Namespace string `json:"namespace,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Key holds the value of the "key" field.
	Key string `json:"key,omitempty"`
	// MeterSlug holds the value of the "meter_slug" field.
	MeterSlug *string `json:"meter_slug,omitempty"`
	// MeterGroupByFilters holds the value of the "meter_group_by_filters" field.
	MeterGroupByFilters map[string]string `json:"meter_group_by_filters,omitempty"`
	// ArchivedAt holds the value of the "archived_at" field.
	ArchivedAt *time.Time `json:"archived_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the FeatureQuery when eager-loading is set.
	Edges FeatureEdges `json:"edges"`
	// contains filtered or unexported fields
}

Feature is the model entity for the Feature schema.

func (*Feature) QueryEntitlement

func (f *Feature) QueryEntitlement() *EntitlementQuery

QueryEntitlement queries the "entitlement" edge of the Feature entity.

func (*Feature) String

func (f *Feature) String() string

String implements the fmt.Stringer.

func (*Feature) Unwrap

func (f *Feature) Unwrap() *Feature

Unwrap unwraps the Feature 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 (*Feature) Update

func (f *Feature) Update() *FeatureUpdateOne

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

func (*Feature) Value

func (f *Feature) Value(name string) (ent.Value, error)

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

type FeatureClient

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

FeatureClient is a client for the Feature schema.

func NewFeatureClient

func NewFeatureClient(c config) *FeatureClient

NewFeatureClient returns a client for the Feature from the given config.

func (*FeatureClient) Create

func (c *FeatureClient) Create() *FeatureCreate

Create returns a builder for creating a Feature entity.

func (*FeatureClient) CreateBulk

func (c *FeatureClient) CreateBulk(builders ...*FeatureCreate) *FeatureCreateBulk

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

func (*FeatureClient) Delete

func (c *FeatureClient) Delete() *FeatureDelete

Delete returns a delete builder for Feature.

func (*FeatureClient) DeleteOne

func (c *FeatureClient) DeleteOne(f *Feature) *FeatureDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FeatureClient) DeleteOneID

func (c *FeatureClient) DeleteOneID(id string) *FeatureDeleteOne

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

func (*FeatureClient) Get

func (c *FeatureClient) Get(ctx context.Context, id string) (*Feature, error)

Get returns a Feature entity by its id.

func (*FeatureClient) GetX

func (c *FeatureClient) GetX(ctx context.Context, id string) *Feature

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

func (*FeatureClient) Hooks

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

Hooks returns the client hooks.

func (*FeatureClient) Intercept

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

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

func (*FeatureClient) Interceptors

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

Interceptors returns the client interceptors.

func (*FeatureClient) MapCreateBulk

func (c *FeatureClient) MapCreateBulk(slice any, setFunc func(*FeatureCreate, int)) *FeatureCreateBulk

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 (*FeatureClient) Query

func (c *FeatureClient) Query() *FeatureQuery

Query returns a query builder for Feature.

func (*FeatureClient) QueryEntitlement

func (c *FeatureClient) QueryEntitlement(f *Feature) *EntitlementQuery

QueryEntitlement queries the entitlement edge of a Feature.

func (*FeatureClient) Update

func (c *FeatureClient) Update() *FeatureUpdate

Update returns an update builder for Feature.

func (*FeatureClient) UpdateOne

func (c *FeatureClient) UpdateOne(f *Feature) *FeatureUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FeatureClient) UpdateOneID

func (c *FeatureClient) UpdateOneID(id string) *FeatureUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FeatureClient) Use

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

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

type FeatureCreate

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

FeatureCreate is the builder for creating a Feature entity.

func (*FeatureCreate) AddEntitlement

func (fc *FeatureCreate) AddEntitlement(e ...*Entitlement) *FeatureCreate

AddEntitlement adds the "entitlement" edges to the Entitlement entity.

func (*FeatureCreate) AddEntitlementIDs

func (fc *FeatureCreate) AddEntitlementIDs(ids ...string) *FeatureCreate

AddEntitlementIDs adds the "entitlement" edge to the Entitlement entity by IDs.

func (*FeatureCreate) Exec

func (fc *FeatureCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*FeatureCreate) ExecX

func (fc *FeatureCreate) ExecX(ctx context.Context)

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

func (*FeatureCreate) Mutation

func (fc *FeatureCreate) Mutation() *FeatureMutation

Mutation returns the FeatureMutation object of the builder.

func (*FeatureCreate) OnConflict

func (fc *FeatureCreate) OnConflict(opts ...sql.ConflictOption) *FeatureUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Feature.Create().
	SetCreatedAt(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.FeatureUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*FeatureCreate) OnConflictColumns

func (fc *FeatureCreate) OnConflictColumns(columns ...string) *FeatureUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Feature.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*FeatureCreate) Save

func (fc *FeatureCreate) Save(ctx context.Context) (*Feature, error)

Save creates the Feature in the database.

func (*FeatureCreate) SaveX

func (fc *FeatureCreate) SaveX(ctx context.Context) *Feature

SaveX calls Save and panics if Save returns an error.

func (*FeatureCreate) SetArchivedAt

func (fc *FeatureCreate) SetArchivedAt(t time.Time) *FeatureCreate

SetArchivedAt sets the "archived_at" field.

func (*FeatureCreate) SetCreatedAt

func (fc *FeatureCreate) SetCreatedAt(t time.Time) *FeatureCreate

SetCreatedAt sets the "created_at" field.

func (*FeatureCreate) SetDeletedAt

func (fc *FeatureCreate) SetDeletedAt(t time.Time) *FeatureCreate

SetDeletedAt sets the "deleted_at" field.

func (*FeatureCreate) SetID

func (fc *FeatureCreate) SetID(s string) *FeatureCreate

SetID sets the "id" field.

func (*FeatureCreate) SetKey

func (fc *FeatureCreate) SetKey(s string) *FeatureCreate

SetKey sets the "key" field.

func (*FeatureCreate) SetMetadata

func (fc *FeatureCreate) SetMetadata(m map[string]string) *FeatureCreate

SetMetadata sets the "metadata" field.

func (*FeatureCreate) SetMeterGroupByFilters

func (fc *FeatureCreate) SetMeterGroupByFilters(m map[string]string) *FeatureCreate

SetMeterGroupByFilters sets the "meter_group_by_filters" field.

func (*FeatureCreate) SetMeterSlug

func (fc *FeatureCreate) SetMeterSlug(s string) *FeatureCreate

SetMeterSlug sets the "meter_slug" field.

func (*FeatureCreate) SetName

func (fc *FeatureCreate) SetName(s string) *FeatureCreate

SetName sets the "name" field.

func (*FeatureCreate) SetNamespace

func (fc *FeatureCreate) SetNamespace(s string) *FeatureCreate

SetNamespace sets the "namespace" field.

func (*FeatureCreate) SetNillableArchivedAt

func (fc *FeatureCreate) SetNillableArchivedAt(t *time.Time) *FeatureCreate

SetNillableArchivedAt sets the "archived_at" field if the given value is not nil.

func (*FeatureCreate) SetNillableCreatedAt

func (fc *FeatureCreate) SetNillableCreatedAt(t *time.Time) *FeatureCreate

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

func (*FeatureCreate) SetNillableDeletedAt

func (fc *FeatureCreate) SetNillableDeletedAt(t *time.Time) *FeatureCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*FeatureCreate) SetNillableID

func (fc *FeatureCreate) SetNillableID(s *string) *FeatureCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*FeatureCreate) SetNillableMeterSlug

func (fc *FeatureCreate) SetNillableMeterSlug(s *string) *FeatureCreate

SetNillableMeterSlug sets the "meter_slug" field if the given value is not nil.

func (*FeatureCreate) SetNillableUpdatedAt

func (fc *FeatureCreate) SetNillableUpdatedAt(t *time.Time) *FeatureCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*FeatureCreate) SetUpdatedAt

func (fc *FeatureCreate) SetUpdatedAt(t time.Time) *FeatureCreate

SetUpdatedAt sets the "updated_at" field.

type FeatureCreateBulk

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

FeatureCreateBulk is the builder for creating many Feature entities in bulk.

func (*FeatureCreateBulk) Exec

func (fcb *FeatureCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FeatureCreateBulk) ExecX

func (fcb *FeatureCreateBulk) ExecX(ctx context.Context)

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

func (*FeatureCreateBulk) OnConflict

func (fcb *FeatureCreateBulk) OnConflict(opts ...sql.ConflictOption) *FeatureUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Feature.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.FeatureUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*FeatureCreateBulk) OnConflictColumns

func (fcb *FeatureCreateBulk) OnConflictColumns(columns ...string) *FeatureUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Feature.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*FeatureCreateBulk) Save

func (fcb *FeatureCreateBulk) Save(ctx context.Context) ([]*Feature, error)

Save creates the Feature entities in the database.

func (*FeatureCreateBulk) SaveX

func (fcb *FeatureCreateBulk) SaveX(ctx context.Context) []*Feature

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

type FeatureDelete

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

FeatureDelete is the builder for deleting a Feature entity.

func (*FeatureDelete) Exec

func (fd *FeatureDelete) Exec(ctx context.Context) (int, error)

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

func (*FeatureDelete) ExecX

func (fd *FeatureDelete) ExecX(ctx context.Context) int

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

func (*FeatureDelete) Where

func (fd *FeatureDelete) Where(ps ...predicate.Feature) *FeatureDelete

Where appends a list predicates to the FeatureDelete builder.

type FeatureDeleteOne

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

FeatureDeleteOne is the builder for deleting a single Feature entity.

func (*FeatureDeleteOne) Exec

func (fdo *FeatureDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FeatureDeleteOne) ExecX

func (fdo *FeatureDeleteOne) ExecX(ctx context.Context)

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

func (*FeatureDeleteOne) Where

Where appends a list predicates to the FeatureDelete builder.

type FeatureEdges

type FeatureEdges struct {
	// Entitlement holds the value of the entitlement edge.
	Entitlement []*Entitlement `json:"entitlement,omitempty"`
	// contains filtered or unexported fields
}

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

func (FeatureEdges) EntitlementOrErr

func (e FeatureEdges) EntitlementOrErr() ([]*Entitlement, error)

EntitlementOrErr returns the Entitlement value or an error if the edge was not loaded in eager-loading.

type FeatureGroupBy

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

FeatureGroupBy is the group-by builder for Feature entities.

func (*FeatureGroupBy) Aggregate

func (fgb *FeatureGroupBy) Aggregate(fns ...AggregateFunc) *FeatureGroupBy

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

func (*FeatureGroupBy) Bool

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

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

func (*FeatureGroupBy) BoolX

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

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

func (*FeatureGroupBy) Bools

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

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

func (*FeatureGroupBy) BoolsX

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

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

func (*FeatureGroupBy) Float64

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

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

func (*FeatureGroupBy) Float64X

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

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

func (*FeatureGroupBy) Float64s

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

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

func (*FeatureGroupBy) Float64sX

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

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

func (*FeatureGroupBy) Int

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

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

func (*FeatureGroupBy) IntX

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

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

func (*FeatureGroupBy) Ints

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

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

func (*FeatureGroupBy) IntsX

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

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

func (*FeatureGroupBy) Scan

func (fgb *FeatureGroupBy) Scan(ctx context.Context, v any) error

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

func (*FeatureGroupBy) ScanX

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

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

func (*FeatureGroupBy) String

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

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

func (*FeatureGroupBy) StringX

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

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

func (*FeatureGroupBy) Strings

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

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

func (*FeatureGroupBy) StringsX

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

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

type FeatureMutation

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

FeatureMutation represents an operation that mutates the Feature nodes in the graph.

func (*FeatureMutation) AddEntitlementIDs

func (m *FeatureMutation) AddEntitlementIDs(ids ...string)

AddEntitlementIDs adds the "entitlement" edge to the Entitlement entity by ids.

func (*FeatureMutation) AddField

func (m *FeatureMutation) 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 (*FeatureMutation) AddedEdges

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

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

func (*FeatureMutation) AddedField

func (m *FeatureMutation) 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 (*FeatureMutation) AddedFields

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

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

func (*FeatureMutation) AddedIDs

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

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

func (*FeatureMutation) ArchivedAt

func (m *FeatureMutation) ArchivedAt() (r time.Time, exists bool)

ArchivedAt returns the value of the "archived_at" field in the mutation.

func (*FeatureMutation) ArchivedAtCleared

func (m *FeatureMutation) ArchivedAtCleared() bool

ArchivedAtCleared returns if the "archived_at" field was cleared in this mutation.

func (*FeatureMutation) ClearArchivedAt

func (m *FeatureMutation) ClearArchivedAt()

ClearArchivedAt clears the value of the "archived_at" field.

func (*FeatureMutation) ClearDeletedAt

func (m *FeatureMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*FeatureMutation) ClearEdge

func (m *FeatureMutation) 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 (*FeatureMutation) ClearEntitlement

func (m *FeatureMutation) ClearEntitlement()

ClearEntitlement clears the "entitlement" edge to the Entitlement entity.

func (*FeatureMutation) ClearField

func (m *FeatureMutation) 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 (*FeatureMutation) ClearMetadata

func (m *FeatureMutation) ClearMetadata()

ClearMetadata clears the value of the "metadata" field.

func (*FeatureMutation) ClearMeterGroupByFilters

func (m *FeatureMutation) ClearMeterGroupByFilters()

ClearMeterGroupByFilters clears the value of the "meter_group_by_filters" field.

func (*FeatureMutation) ClearMeterSlug

func (m *FeatureMutation) ClearMeterSlug()

ClearMeterSlug clears the value of the "meter_slug" field.

func (*FeatureMutation) ClearedEdges

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

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

func (*FeatureMutation) ClearedFields

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

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

func (FeatureMutation) Client

func (m FeatureMutation) 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 (*FeatureMutation) CreatedAt

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

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

func (*FeatureMutation) DeletedAt

func (m *FeatureMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*FeatureMutation) DeletedAtCleared

func (m *FeatureMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*FeatureMutation) EdgeCleared

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

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

func (*FeatureMutation) EntitlementCleared

func (m *FeatureMutation) EntitlementCleared() bool

EntitlementCleared reports if the "entitlement" edge to the Entitlement entity was cleared.

func (*FeatureMutation) EntitlementIDs

func (m *FeatureMutation) EntitlementIDs() (ids []string)

EntitlementIDs returns the "entitlement" edge IDs in the mutation.

func (*FeatureMutation) Field

func (m *FeatureMutation) 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 (*FeatureMutation) FieldCleared

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

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

func (*FeatureMutation) Fields

func (m *FeatureMutation) 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 (*FeatureMutation) ID

func (m *FeatureMutation) ID() (id string, 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 (*FeatureMutation) IDs

func (m *FeatureMutation) IDs(ctx context.Context) ([]string, 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 (*FeatureMutation) Key

func (m *FeatureMutation) Key() (r string, exists bool)

Key returns the value of the "key" field in the mutation.

func (*FeatureMutation) Metadata

func (m *FeatureMutation) Metadata() (r map[string]string, exists bool)

Metadata returns the value of the "metadata" field in the mutation.

func (*FeatureMutation) MetadataCleared

func (m *FeatureMutation) MetadataCleared() bool

MetadataCleared returns if the "metadata" field was cleared in this mutation.

func (*FeatureMutation) MeterGroupByFilters

func (m *FeatureMutation) MeterGroupByFilters() (r map[string]string, exists bool)

MeterGroupByFilters returns the value of the "meter_group_by_filters" field in the mutation.

func (*FeatureMutation) MeterGroupByFiltersCleared

func (m *FeatureMutation) MeterGroupByFiltersCleared() bool

MeterGroupByFiltersCleared returns if the "meter_group_by_filters" field was cleared in this mutation.

func (*FeatureMutation) MeterSlug

func (m *FeatureMutation) MeterSlug() (r string, exists bool)

MeterSlug returns the value of the "meter_slug" field in the mutation.

func (*FeatureMutation) MeterSlugCleared

func (m *FeatureMutation) MeterSlugCleared() bool

MeterSlugCleared returns if the "meter_slug" field was cleared in this mutation.

func (*FeatureMutation) Name

func (m *FeatureMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*FeatureMutation) Namespace

func (m *FeatureMutation) Namespace() (r string, exists bool)

Namespace returns the value of the "namespace" field in the mutation.

func (*FeatureMutation) OldArchivedAt

func (m *FeatureMutation) OldArchivedAt(ctx context.Context) (v *time.Time, err error)

OldArchivedAt returns the old "archived_at" field's value of the Feature entity. If the Feature 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 (*FeatureMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the Feature entity. If the Feature 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 (*FeatureMutation) OldDeletedAt

func (m *FeatureMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Feature entity. If the Feature 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 (*FeatureMutation) OldField

func (m *FeatureMutation) 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 (*FeatureMutation) OldKey

func (m *FeatureMutation) OldKey(ctx context.Context) (v string, err error)

OldKey returns the old "key" field's value of the Feature entity. If the Feature 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 (*FeatureMutation) OldMetadata

func (m *FeatureMutation) OldMetadata(ctx context.Context) (v map[string]string, err error)

OldMetadata returns the old "metadata" field's value of the Feature entity. If the Feature 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 (*FeatureMutation) OldMeterGroupByFilters

func (m *FeatureMutation) OldMeterGroupByFilters(ctx context.Context) (v map[string]string, err error)

OldMeterGroupByFilters returns the old "meter_group_by_filters" field's value of the Feature entity. If the Feature 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 (*FeatureMutation) OldMeterSlug

func (m *FeatureMutation) OldMeterSlug(ctx context.Context) (v *string, err error)

OldMeterSlug returns the old "meter_slug" field's value of the Feature entity. If the Feature 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 (*FeatureMutation) OldName

func (m *FeatureMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Feature entity. If the Feature 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 (*FeatureMutation) OldNamespace

func (m *FeatureMutation) OldNamespace(ctx context.Context) (v string, err error)

OldNamespace returns the old "namespace" field's value of the Feature entity. If the Feature 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 (*FeatureMutation) OldUpdatedAt

func (m *FeatureMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Feature entity. If the Feature 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 (*FeatureMutation) Op

func (m *FeatureMutation) Op() Op

Op returns the operation name.

func (*FeatureMutation) RemoveEntitlementIDs

func (m *FeatureMutation) RemoveEntitlementIDs(ids ...string)

RemoveEntitlementIDs removes the "entitlement" edge to the Entitlement entity by IDs.

func (*FeatureMutation) RemovedEdges

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

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

func (*FeatureMutation) RemovedEntitlementIDs

func (m *FeatureMutation) RemovedEntitlementIDs() (ids []string)

RemovedEntitlement returns the removed IDs of the "entitlement" edge to the Entitlement entity.

func (*FeatureMutation) RemovedIDs

func (m *FeatureMutation) 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 (*FeatureMutation) ResetArchivedAt

func (m *FeatureMutation) ResetArchivedAt()

ResetArchivedAt resets all changes to the "archived_at" field.

func (*FeatureMutation) ResetCreatedAt

func (m *FeatureMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*FeatureMutation) ResetDeletedAt

func (m *FeatureMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*FeatureMutation) ResetEdge

func (m *FeatureMutation) 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 (*FeatureMutation) ResetEntitlement

func (m *FeatureMutation) ResetEntitlement()

ResetEntitlement resets all changes to the "entitlement" edge.

func (*FeatureMutation) ResetField

func (m *FeatureMutation) 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 (*FeatureMutation) ResetKey

func (m *FeatureMutation) ResetKey()

ResetKey resets all changes to the "key" field.

func (*FeatureMutation) ResetMetadata

func (m *FeatureMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" field.

func (*FeatureMutation) ResetMeterGroupByFilters

func (m *FeatureMutation) ResetMeterGroupByFilters()

ResetMeterGroupByFilters resets all changes to the "meter_group_by_filters" field.

func (*FeatureMutation) ResetMeterSlug

func (m *FeatureMutation) ResetMeterSlug()

ResetMeterSlug resets all changes to the "meter_slug" field.

func (*FeatureMutation) ResetName

func (m *FeatureMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*FeatureMutation) ResetNamespace

func (m *FeatureMutation) ResetNamespace()

ResetNamespace resets all changes to the "namespace" field.

func (*FeatureMutation) ResetUpdatedAt

func (m *FeatureMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*FeatureMutation) SetArchivedAt

func (m *FeatureMutation) SetArchivedAt(t time.Time)

SetArchivedAt sets the "archived_at" field.

func (*FeatureMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*FeatureMutation) SetDeletedAt

func (m *FeatureMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*FeatureMutation) SetField

func (m *FeatureMutation) 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 (*FeatureMutation) SetID

func (m *FeatureMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Feature entities.

func (*FeatureMutation) SetKey

func (m *FeatureMutation) SetKey(s string)

SetKey sets the "key" field.

func (*FeatureMutation) SetMetadata

func (m *FeatureMutation) SetMetadata(value map[string]string)

SetMetadata sets the "metadata" field.

func (*FeatureMutation) SetMeterGroupByFilters

func (m *FeatureMutation) SetMeterGroupByFilters(value map[string]string)

SetMeterGroupByFilters sets the "meter_group_by_filters" field.

func (*FeatureMutation) SetMeterSlug

func (m *FeatureMutation) SetMeterSlug(s string)

SetMeterSlug sets the "meter_slug" field.

func (*FeatureMutation) SetName

func (m *FeatureMutation) SetName(s string)

SetName sets the "name" field.

func (*FeatureMutation) SetNamespace

func (m *FeatureMutation) SetNamespace(s string)

SetNamespace sets the "namespace" field.

func (*FeatureMutation) SetOp

func (m *FeatureMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*FeatureMutation) SetUpdatedAt

func (m *FeatureMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (FeatureMutation) Tx

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

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

func (*FeatureMutation) Type

func (m *FeatureMutation) Type() string

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

func (*FeatureMutation) UpdatedAt

func (m *FeatureMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*FeatureMutation) Where

func (m *FeatureMutation) Where(ps ...predicate.Feature)

Where appends a list predicates to the FeatureMutation builder.

func (*FeatureMutation) WhereP

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

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

type FeatureQuery

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

FeatureQuery is the builder for querying Feature entities.

func (*FeatureQuery) Aggregate

func (fq *FeatureQuery) Aggregate(fns ...AggregateFunc) *FeatureSelect

Aggregate returns a FeatureSelect configured with the given aggregations.

func (*FeatureQuery) All

func (fq *FeatureQuery) All(ctx context.Context) ([]*Feature, error)

All executes the query and returns a list of Features.

func (*FeatureQuery) AllX

func (fq *FeatureQuery) AllX(ctx context.Context) []*Feature

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

func (*FeatureQuery) Clone

func (fq *FeatureQuery) Clone() *FeatureQuery

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

func (*FeatureQuery) Count

func (fq *FeatureQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FeatureQuery) CountX

func (fq *FeatureQuery) CountX(ctx context.Context) int

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

func (*FeatureQuery) Exist

func (fq *FeatureQuery) Exist(ctx context.Context) (bool, error)

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

func (*FeatureQuery) ExistX

func (fq *FeatureQuery) ExistX(ctx context.Context) bool

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

func (*FeatureQuery) First

func (fq *FeatureQuery) First(ctx context.Context) (*Feature, error)

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

func (*FeatureQuery) FirstID

func (fq *FeatureQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*FeatureQuery) FirstIDX

func (fq *FeatureQuery) FirstIDX(ctx context.Context) string

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

func (*FeatureQuery) FirstX

func (fq *FeatureQuery) FirstX(ctx context.Context) *Feature

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

func (*FeatureQuery) ForShare

func (fq *FeatureQuery) ForShare(opts ...sql.LockOption) *FeatureQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*FeatureQuery) ForUpdate

func (fq *FeatureQuery) ForUpdate(opts ...sql.LockOption) *FeatureQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*FeatureQuery) GroupBy

func (fq *FeatureQuery) GroupBy(field string, fields ...string) *FeatureGroupBy

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Feature.Query().
	GroupBy(feature.FieldCreatedAt).
	Aggregate(db.Count()).
	Scan(ctx, &v)

func (*FeatureQuery) IDs

func (fq *FeatureQuery) IDs(ctx context.Context) (ids []string, err error)

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

func (*FeatureQuery) IDsX

func (fq *FeatureQuery) IDsX(ctx context.Context) []string

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

func (*FeatureQuery) Limit

func (fq *FeatureQuery) Limit(limit int) *FeatureQuery

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

func (*FeatureQuery) Offset

func (fq *FeatureQuery) Offset(offset int) *FeatureQuery

Offset to start from.

func (*FeatureQuery) Only

func (fq *FeatureQuery) Only(ctx context.Context) (*Feature, error)

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

func (*FeatureQuery) OnlyID

func (fq *FeatureQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*FeatureQuery) OnlyIDX

func (fq *FeatureQuery) OnlyIDX(ctx context.Context) string

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

func (*FeatureQuery) OnlyX

func (fq *FeatureQuery) OnlyX(ctx context.Context) *Feature

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

func (*FeatureQuery) Order

func (fq *FeatureQuery) Order(o ...feature.OrderOption) *FeatureQuery

Order specifies how the records should be ordered.

func (*FeatureQuery) Paginate

Paginate runs the query and returns a paginated response. If page is its 0 value then it will return all the items and populate the response page accordingly.

func (*FeatureQuery) QueryEntitlement

func (fq *FeatureQuery) QueryEntitlement() *EntitlementQuery

QueryEntitlement chains the current query on the "entitlement" edge.

func (*FeatureQuery) Select

func (fq *FeatureQuery) Select(fields ...string) *FeatureSelect

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Feature.Query().
	Select(feature.FieldCreatedAt).
	Scan(ctx, &v)

func (*FeatureQuery) Unique

func (fq *FeatureQuery) Unique(unique bool) *FeatureQuery

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 (*FeatureQuery) Where

func (fq *FeatureQuery) Where(ps ...predicate.Feature) *FeatureQuery

Where adds a new predicate for the FeatureQuery builder.

func (*FeatureQuery) WithEntitlement

func (fq *FeatureQuery) WithEntitlement(opts ...func(*EntitlementQuery)) *FeatureQuery

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

type FeatureSelect

type FeatureSelect struct {
	*FeatureQuery
	// contains filtered or unexported fields
}

FeatureSelect is the builder for selecting fields of Feature entities.

func (*FeatureSelect) Aggregate

func (fs *FeatureSelect) Aggregate(fns ...AggregateFunc) *FeatureSelect

Aggregate adds the given aggregation functions to the selector query.

func (*FeatureSelect) Bool

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

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

func (*FeatureSelect) BoolX

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

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

func (*FeatureSelect) Bools

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

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

func (*FeatureSelect) BoolsX

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

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

func (*FeatureSelect) Float64

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

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

func (*FeatureSelect) Float64X

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

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

func (*FeatureSelect) Float64s

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

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

func (*FeatureSelect) Float64sX

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

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

func (*FeatureSelect) Int

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

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

func (*FeatureSelect) IntX

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

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

func (*FeatureSelect) Ints

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

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

func (*FeatureSelect) IntsX

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

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

func (*FeatureSelect) Scan

func (fs *FeatureSelect) Scan(ctx context.Context, v any) error

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

func (*FeatureSelect) ScanX

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

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

func (*FeatureSelect) String

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

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

func (*FeatureSelect) StringX

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

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

func (*FeatureSelect) Strings

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

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

func (*FeatureSelect) StringsX

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

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

type FeatureUpdate

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

FeatureUpdate is the builder for updating Feature entities.

func (*FeatureUpdate) AddEntitlement

func (fu *FeatureUpdate) AddEntitlement(e ...*Entitlement) *FeatureUpdate

AddEntitlement adds the "entitlement" edges to the Entitlement entity.

func (*FeatureUpdate) AddEntitlementIDs

func (fu *FeatureUpdate) AddEntitlementIDs(ids ...string) *FeatureUpdate

AddEntitlementIDs adds the "entitlement" edge to the Entitlement entity by IDs.

func (*FeatureUpdate) ClearArchivedAt

func (fu *FeatureUpdate) ClearArchivedAt() *FeatureUpdate

ClearArchivedAt clears the value of the "archived_at" field.

func (*FeatureUpdate) ClearDeletedAt

func (fu *FeatureUpdate) ClearDeletedAt() *FeatureUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*FeatureUpdate) ClearEntitlement

func (fu *FeatureUpdate) ClearEntitlement() *FeatureUpdate

ClearEntitlement clears all "entitlement" edges to the Entitlement entity.

func (*FeatureUpdate) ClearMetadata

func (fu *FeatureUpdate) ClearMetadata() *FeatureUpdate

ClearMetadata clears the value of the "metadata" field.

func (*FeatureUpdate) ClearMeterGroupByFilters

func (fu *FeatureUpdate) ClearMeterGroupByFilters() *FeatureUpdate

ClearMeterGroupByFilters clears the value of the "meter_group_by_filters" field.

func (*FeatureUpdate) Exec

func (fu *FeatureUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FeatureUpdate) ExecX

func (fu *FeatureUpdate) ExecX(ctx context.Context)

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

func (*FeatureUpdate) Mutation

func (fu *FeatureUpdate) Mutation() *FeatureMutation

Mutation returns the FeatureMutation object of the builder.

func (*FeatureUpdate) RemoveEntitlement

func (fu *FeatureUpdate) RemoveEntitlement(e ...*Entitlement) *FeatureUpdate

RemoveEntitlement removes "entitlement" edges to Entitlement entities.

func (*FeatureUpdate) RemoveEntitlementIDs

func (fu *FeatureUpdate) RemoveEntitlementIDs(ids ...string) *FeatureUpdate

RemoveEntitlementIDs removes the "entitlement" edge to Entitlement entities by IDs.

func (*FeatureUpdate) Save

func (fu *FeatureUpdate) Save(ctx context.Context) (int, error)

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

func (*FeatureUpdate) SaveX

func (fu *FeatureUpdate) SaveX(ctx context.Context) int

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

func (*FeatureUpdate) SetArchivedAt

func (fu *FeatureUpdate) SetArchivedAt(t time.Time) *FeatureUpdate

SetArchivedAt sets the "archived_at" field.

func (*FeatureUpdate) SetDeletedAt

func (fu *FeatureUpdate) SetDeletedAt(t time.Time) *FeatureUpdate

SetDeletedAt sets the "deleted_at" field.

func (*FeatureUpdate) SetMetadata

func (fu *FeatureUpdate) SetMetadata(m map[string]string) *FeatureUpdate

SetMetadata sets the "metadata" field.

func (*FeatureUpdate) SetMeterGroupByFilters

func (fu *FeatureUpdate) SetMeterGroupByFilters(m map[string]string) *FeatureUpdate

SetMeterGroupByFilters sets the "meter_group_by_filters" field.

func (*FeatureUpdate) SetName

func (fu *FeatureUpdate) SetName(s string) *FeatureUpdate

SetName sets the "name" field.

func (*FeatureUpdate) SetNillableArchivedAt

func (fu *FeatureUpdate) SetNillableArchivedAt(t *time.Time) *FeatureUpdate

SetNillableArchivedAt sets the "archived_at" field if the given value is not nil.

func (*FeatureUpdate) SetNillableDeletedAt

func (fu *FeatureUpdate) SetNillableDeletedAt(t *time.Time) *FeatureUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*FeatureUpdate) SetNillableName

func (fu *FeatureUpdate) SetNillableName(s *string) *FeatureUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*FeatureUpdate) SetUpdatedAt

func (fu *FeatureUpdate) SetUpdatedAt(t time.Time) *FeatureUpdate

SetUpdatedAt sets the "updated_at" field.

func (*FeatureUpdate) Where

func (fu *FeatureUpdate) Where(ps ...predicate.Feature) *FeatureUpdate

Where appends a list predicates to the FeatureUpdate builder.

type FeatureUpdateOne

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

FeatureUpdateOne is the builder for updating a single Feature entity.

func (*FeatureUpdateOne) AddEntitlement

func (fuo *FeatureUpdateOne) AddEntitlement(e ...*Entitlement) *FeatureUpdateOne

AddEntitlement adds the "entitlement" edges to the Entitlement entity.

func (*FeatureUpdateOne) AddEntitlementIDs

func (fuo *FeatureUpdateOne) AddEntitlementIDs(ids ...string) *FeatureUpdateOne

AddEntitlementIDs adds the "entitlement" edge to the Entitlement entity by IDs.

func (*FeatureUpdateOne) ClearArchivedAt

func (fuo *FeatureUpdateOne) ClearArchivedAt() *FeatureUpdateOne

ClearArchivedAt clears the value of the "archived_at" field.

func (*FeatureUpdateOne) ClearDeletedAt

func (fuo *FeatureUpdateOne) ClearDeletedAt() *FeatureUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*FeatureUpdateOne) ClearEntitlement

func (fuo *FeatureUpdateOne) ClearEntitlement() *FeatureUpdateOne

ClearEntitlement clears all "entitlement" edges to the Entitlement entity.

func (*FeatureUpdateOne) ClearMetadata

func (fuo *FeatureUpdateOne) ClearMetadata() *FeatureUpdateOne

ClearMetadata clears the value of the "metadata" field.

func (*FeatureUpdateOne) ClearMeterGroupByFilters

func (fuo *FeatureUpdateOne) ClearMeterGroupByFilters() *FeatureUpdateOne

ClearMeterGroupByFilters clears the value of the "meter_group_by_filters" field.

func (*FeatureUpdateOne) Exec

func (fuo *FeatureUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FeatureUpdateOne) ExecX

func (fuo *FeatureUpdateOne) ExecX(ctx context.Context)

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

func (*FeatureUpdateOne) Mutation

func (fuo *FeatureUpdateOne) Mutation() *FeatureMutation

Mutation returns the FeatureMutation object of the builder.

func (*FeatureUpdateOne) RemoveEntitlement

func (fuo *FeatureUpdateOne) RemoveEntitlement(e ...*Entitlement) *FeatureUpdateOne

RemoveEntitlement removes "entitlement" edges to Entitlement entities.

func (*FeatureUpdateOne) RemoveEntitlementIDs

func (fuo *FeatureUpdateOne) RemoveEntitlementIDs(ids ...string) *FeatureUpdateOne

RemoveEntitlementIDs removes the "entitlement" edge to Entitlement entities by IDs.

func (*FeatureUpdateOne) Save

func (fuo *FeatureUpdateOne) Save(ctx context.Context) (*Feature, error)

Save executes the query and returns the updated Feature entity.

func (*FeatureUpdateOne) SaveX

func (fuo *FeatureUpdateOne) SaveX(ctx context.Context) *Feature

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

func (*FeatureUpdateOne) Select

func (fuo *FeatureUpdateOne) Select(field string, fields ...string) *FeatureUpdateOne

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

func (*FeatureUpdateOne) SetArchivedAt

func (fuo *FeatureUpdateOne) SetArchivedAt(t time.Time) *FeatureUpdateOne

SetArchivedAt sets the "archived_at" field.

func (*FeatureUpdateOne) SetDeletedAt

func (fuo *FeatureUpdateOne) SetDeletedAt(t time.Time) *FeatureUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*FeatureUpdateOne) SetMetadata

func (fuo *FeatureUpdateOne) SetMetadata(m map[string]string) *FeatureUpdateOne

SetMetadata sets the "metadata" field.

func (*FeatureUpdateOne) SetMeterGroupByFilters

func (fuo *FeatureUpdateOne) SetMeterGroupByFilters(m map[string]string) *FeatureUpdateOne

SetMeterGroupByFilters sets the "meter_group_by_filters" field.

func (*FeatureUpdateOne) SetName

func (fuo *FeatureUpdateOne) SetName(s string) *FeatureUpdateOne

SetName sets the "name" field.

func (*FeatureUpdateOne) SetNillableArchivedAt

func (fuo *FeatureUpdateOne) SetNillableArchivedAt(t *time.Time) *FeatureUpdateOne

SetNillableArchivedAt sets the "archived_at" field if the given value is not nil.

func (*FeatureUpdateOne) SetNillableDeletedAt

func (fuo *FeatureUpdateOne) SetNillableDeletedAt(t *time.Time) *FeatureUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*FeatureUpdateOne) SetNillableName

func (fuo *FeatureUpdateOne) SetNillableName(s *string) *FeatureUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*FeatureUpdateOne) SetUpdatedAt

func (fuo *FeatureUpdateOne) SetUpdatedAt(t time.Time) *FeatureUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*FeatureUpdateOne) Where

Where appends a list predicates to the FeatureUpdate builder.

type FeatureUpsert

type FeatureUpsert struct {
	*sql.UpdateSet
}

FeatureUpsert is the "OnConflict" setter.

func (*FeatureUpsert) ClearArchivedAt

func (u *FeatureUpsert) ClearArchivedAt() *FeatureUpsert

ClearArchivedAt clears the value of the "archived_at" field.

func (*FeatureUpsert) ClearDeletedAt

func (u *FeatureUpsert) ClearDeletedAt() *FeatureUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*FeatureUpsert) ClearMetadata

func (u *FeatureUpsert) ClearMetadata() *FeatureUpsert

ClearMetadata clears the value of the "metadata" field.

func (*FeatureUpsert) ClearMeterGroupByFilters

func (u *FeatureUpsert) ClearMeterGroupByFilters() *FeatureUpsert

ClearMeterGroupByFilters clears the value of the "meter_group_by_filters" field.

func (*FeatureUpsert) SetArchivedAt

func (u *FeatureUpsert) SetArchivedAt(v time.Time) *FeatureUpsert

SetArchivedAt sets the "archived_at" field.

func (*FeatureUpsert) SetDeletedAt

func (u *FeatureUpsert) SetDeletedAt(v time.Time) *FeatureUpsert

SetDeletedAt sets the "deleted_at" field.

func (*FeatureUpsert) SetMetadata

func (u *FeatureUpsert) SetMetadata(v map[string]string) *FeatureUpsert

SetMetadata sets the "metadata" field.

func (*FeatureUpsert) SetMeterGroupByFilters

func (u *FeatureUpsert) SetMeterGroupByFilters(v map[string]string) *FeatureUpsert

SetMeterGroupByFilters sets the "meter_group_by_filters" field.

func (*FeatureUpsert) SetName

func (u *FeatureUpsert) SetName(v string) *FeatureUpsert

SetName sets the "name" field.

func (*FeatureUpsert) SetUpdatedAt

func (u *FeatureUpsert) SetUpdatedAt(v time.Time) *FeatureUpsert

SetUpdatedAt sets the "updated_at" field.

func (*FeatureUpsert) UpdateArchivedAt

func (u *FeatureUpsert) UpdateArchivedAt() *FeatureUpsert

UpdateArchivedAt sets the "archived_at" field to the value that was provided on create.

func (*FeatureUpsert) UpdateDeletedAt

func (u *FeatureUpsert) UpdateDeletedAt() *FeatureUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*FeatureUpsert) UpdateMetadata

func (u *FeatureUpsert) UpdateMetadata() *FeatureUpsert

UpdateMetadata sets the "metadata" field to the value that was provided on create.

func (*FeatureUpsert) UpdateMeterGroupByFilters

func (u *FeatureUpsert) UpdateMeterGroupByFilters() *FeatureUpsert

UpdateMeterGroupByFilters sets the "meter_group_by_filters" field to the value that was provided on create.

func (*FeatureUpsert) UpdateName

func (u *FeatureUpsert) UpdateName() *FeatureUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*FeatureUpsert) UpdateUpdatedAt

func (u *FeatureUpsert) UpdateUpdatedAt() *FeatureUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type FeatureUpsertBulk

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

FeatureUpsertBulk is the builder for "upsert"-ing a bulk of Feature nodes.

func (*FeatureUpsertBulk) ClearArchivedAt

func (u *FeatureUpsertBulk) ClearArchivedAt() *FeatureUpsertBulk

ClearArchivedAt clears the value of the "archived_at" field.

func (*FeatureUpsertBulk) ClearDeletedAt

func (u *FeatureUpsertBulk) ClearDeletedAt() *FeatureUpsertBulk

ClearDeletedAt clears the value of the "deleted_at" field.

func (*FeatureUpsertBulk) ClearMetadata

func (u *FeatureUpsertBulk) ClearMetadata() *FeatureUpsertBulk

ClearMetadata clears the value of the "metadata" field.

func (*FeatureUpsertBulk) ClearMeterGroupByFilters

func (u *FeatureUpsertBulk) ClearMeterGroupByFilters() *FeatureUpsertBulk

ClearMeterGroupByFilters clears the value of the "meter_group_by_filters" field.

func (*FeatureUpsertBulk) DoNothing

func (u *FeatureUpsertBulk) DoNothing() *FeatureUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*FeatureUpsertBulk) Exec

func (u *FeatureUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FeatureUpsertBulk) ExecX

func (u *FeatureUpsertBulk) ExecX(ctx context.Context)

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

func (*FeatureUpsertBulk) Ignore

func (u *FeatureUpsertBulk) Ignore() *FeatureUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Feature.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*FeatureUpsertBulk) SetArchivedAt

func (u *FeatureUpsertBulk) SetArchivedAt(v time.Time) *FeatureUpsertBulk

SetArchivedAt sets the "archived_at" field.

func (*FeatureUpsertBulk) SetDeletedAt

func (u *FeatureUpsertBulk) SetDeletedAt(v time.Time) *FeatureUpsertBulk

SetDeletedAt sets the "deleted_at" field.

func (*FeatureUpsertBulk) SetMetadata

func (u *FeatureUpsertBulk) SetMetadata(v map[string]string) *FeatureUpsertBulk

SetMetadata sets the "metadata" field.

func (*FeatureUpsertBulk) SetMeterGroupByFilters

func (u *FeatureUpsertBulk) SetMeterGroupByFilters(v map[string]string) *FeatureUpsertBulk

SetMeterGroupByFilters sets the "meter_group_by_filters" field.

func (*FeatureUpsertBulk) SetName

SetName sets the "name" field.

func (*FeatureUpsertBulk) SetUpdatedAt

func (u *FeatureUpsertBulk) SetUpdatedAt(v time.Time) *FeatureUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*FeatureUpsertBulk) Update

func (u *FeatureUpsertBulk) Update(set func(*FeatureUpsert)) *FeatureUpsertBulk

Update allows overriding fields `UPDATE` values. See the FeatureCreateBulk.OnConflict documentation for more info.

func (*FeatureUpsertBulk) UpdateArchivedAt

func (u *FeatureUpsertBulk) UpdateArchivedAt() *FeatureUpsertBulk

UpdateArchivedAt sets the "archived_at" field to the value that was provided on create.

func (*FeatureUpsertBulk) UpdateDeletedAt

func (u *FeatureUpsertBulk) UpdateDeletedAt() *FeatureUpsertBulk

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*FeatureUpsertBulk) UpdateMetadata

func (u *FeatureUpsertBulk) UpdateMetadata() *FeatureUpsertBulk

UpdateMetadata sets the "metadata" field to the value that was provided on create.

func (*FeatureUpsertBulk) UpdateMeterGroupByFilters

func (u *FeatureUpsertBulk) UpdateMeterGroupByFilters() *FeatureUpsertBulk

UpdateMeterGroupByFilters sets the "meter_group_by_filters" field to the value that was provided on create.

func (*FeatureUpsertBulk) UpdateName

func (u *FeatureUpsertBulk) UpdateName() *FeatureUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*FeatureUpsertBulk) UpdateNewValues

func (u *FeatureUpsertBulk) UpdateNewValues() *FeatureUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Feature.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(feature.FieldID)
		}),
	).
	Exec(ctx)

func (*FeatureUpsertBulk) UpdateUpdatedAt

func (u *FeatureUpsertBulk) UpdateUpdatedAt() *FeatureUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type FeatureUpsertOne

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

FeatureUpsertOne is the builder for "upsert"-ing

one Feature node.

func (*FeatureUpsertOne) ClearArchivedAt

func (u *FeatureUpsertOne) ClearArchivedAt() *FeatureUpsertOne

ClearArchivedAt clears the value of the "archived_at" field.

func (*FeatureUpsertOne) ClearDeletedAt

func (u *FeatureUpsertOne) ClearDeletedAt() *FeatureUpsertOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*FeatureUpsertOne) ClearMetadata

func (u *FeatureUpsertOne) ClearMetadata() *FeatureUpsertOne

ClearMetadata clears the value of the "metadata" field.

func (*FeatureUpsertOne) ClearMeterGroupByFilters

func (u *FeatureUpsertOne) ClearMeterGroupByFilters() *FeatureUpsertOne

ClearMeterGroupByFilters clears the value of the "meter_group_by_filters" field.

func (*FeatureUpsertOne) DoNothing

func (u *FeatureUpsertOne) DoNothing() *FeatureUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*FeatureUpsertOne) Exec

func (u *FeatureUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*FeatureUpsertOne) ExecX

func (u *FeatureUpsertOne) ExecX(ctx context.Context)

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

func (*FeatureUpsertOne) ID

func (u *FeatureUpsertOne) ID(ctx context.Context) (id string, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*FeatureUpsertOne) IDX

func (u *FeatureUpsertOne) IDX(ctx context.Context) string

IDX is like ID, but panics if an error occurs.

func (*FeatureUpsertOne) Ignore

func (u *FeatureUpsertOne) Ignore() *FeatureUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Feature.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*FeatureUpsertOne) SetArchivedAt

func (u *FeatureUpsertOne) SetArchivedAt(v time.Time) *FeatureUpsertOne

SetArchivedAt sets the "archived_at" field.

func (*FeatureUpsertOne) SetDeletedAt

func (u *FeatureUpsertOne) SetDeletedAt(v time.Time) *FeatureUpsertOne

SetDeletedAt sets the "deleted_at" field.

func (*FeatureUpsertOne) SetMetadata

func (u *FeatureUpsertOne) SetMetadata(v map[string]string) *FeatureUpsertOne

SetMetadata sets the "metadata" field.

func (*FeatureUpsertOne) SetMeterGroupByFilters

func (u *FeatureUpsertOne) SetMeterGroupByFilters(v map[string]string) *FeatureUpsertOne

SetMeterGroupByFilters sets the "meter_group_by_filters" field.

func (*FeatureUpsertOne) SetName

func (u *FeatureUpsertOne) SetName(v string) *FeatureUpsertOne

SetName sets the "name" field.

func (*FeatureUpsertOne) SetUpdatedAt

func (u *FeatureUpsertOne) SetUpdatedAt(v time.Time) *FeatureUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*FeatureUpsertOne) Update

func (u *FeatureUpsertOne) Update(set func(*FeatureUpsert)) *FeatureUpsertOne

Update allows overriding fields `UPDATE` values. See the FeatureCreate.OnConflict documentation for more info.

func (*FeatureUpsertOne) UpdateArchivedAt

func (u *FeatureUpsertOne) UpdateArchivedAt() *FeatureUpsertOne

UpdateArchivedAt sets the "archived_at" field to the value that was provided on create.

func (*FeatureUpsertOne) UpdateDeletedAt

func (u *FeatureUpsertOne) UpdateDeletedAt() *FeatureUpsertOne

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*FeatureUpsertOne) UpdateMetadata

func (u *FeatureUpsertOne) UpdateMetadata() *FeatureUpsertOne

UpdateMetadata sets the "metadata" field to the value that was provided on create.

func (*FeatureUpsertOne) UpdateMeterGroupByFilters

func (u *FeatureUpsertOne) UpdateMeterGroupByFilters() *FeatureUpsertOne

UpdateMeterGroupByFilters sets the "meter_group_by_filters" field to the value that was provided on create.

func (*FeatureUpsertOne) UpdateName

func (u *FeatureUpsertOne) UpdateName() *FeatureUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*FeatureUpsertOne) UpdateNewValues

func (u *FeatureUpsertOne) UpdateNewValues() *FeatureUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Feature.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(feature.FieldID)
		}),
	).
	Exec(ctx)

func (*FeatureUpsertOne) UpdateUpdatedAt

func (u *FeatureUpsertOne) UpdateUpdatedAt() *FeatureUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type Features

type Features []*Feature

Features is a parsable slice of Feature.

type Grant

type Grant struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// Namespace holds the value of the "namespace" field.
	Namespace string `json:"namespace,omitempty"`
	// Metadata holds the value of the "metadata" field.
	Metadata map[string]string `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"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// OwnerID holds the value of the "owner_id" field.
	OwnerID string `json:"owner_id,omitempty"`
	// Amount holds the value of the "amount" field.
	Amount float64 `json:"amount,omitempty"`
	// Priority holds the value of the "priority" field.
	Priority uint8 `json:"priority,omitempty"`
	// EffectiveAt holds the value of the "effective_at" field.
	EffectiveAt time.Time `json:"effective_at,omitempty"`
	// Expiration holds the value of the "expiration" field.
	Expiration grant.ExpirationPeriod `json:"expiration,omitempty"`
	// ExpiresAt holds the value of the "expires_at" field.
	ExpiresAt time.Time `json:"expires_at,omitempty"`
	// VoidedAt holds the value of the "voided_at" field.
	VoidedAt *time.Time `json:"voided_at,omitempty"`
	// ResetMaxRollover holds the value of the "reset_max_rollover" field.
	ResetMaxRollover float64 `json:"reset_max_rollover,omitempty"`
	// ResetMinRollover holds the value of the "reset_min_rollover" field.
	ResetMinRollover float64 `json:"reset_min_rollover,omitempty"`
	// RecurrencePeriod holds the value of the "recurrence_period" field.
	RecurrencePeriod *recurrence.RecurrenceInterval `json:"recurrence_period,omitempty"`
	// RecurrenceAnchor holds the value of the "recurrence_anchor" field.
	RecurrenceAnchor *time.Time `json:"recurrence_anchor,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GrantQuery when eager-loading is set.
	Edges GrantEdges `json:"edges"`
	// contains filtered or unexported fields
}

Grant is the model entity for the Grant schema.

func (*Grant) QueryEntitlement

func (gr *Grant) QueryEntitlement() *EntitlementQuery

QueryEntitlement queries the "entitlement" edge of the Grant entity.

func (*Grant) String

func (gr *Grant) String() string

String implements the fmt.Stringer.

func (*Grant) Unwrap

func (gr *Grant) Unwrap() *Grant

Unwrap unwraps the Grant 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 (*Grant) Update

func (gr *Grant) Update() *GrantUpdateOne

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

func (*Grant) Value

func (gr *Grant) Value(name string) (ent.Value, error)

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

type GrantClient

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

GrantClient is a client for the Grant schema.

func NewGrantClient

func NewGrantClient(c config) *GrantClient

NewGrantClient returns a client for the Grant from the given config.

func (*GrantClient) Create

func (c *GrantClient) Create() *GrantCreate

Create returns a builder for creating a Grant entity.

func (*GrantClient) CreateBulk

func (c *GrantClient) CreateBulk(builders ...*GrantCreate) *GrantCreateBulk

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

func (*GrantClient) Delete

func (c *GrantClient) Delete() *GrantDelete

Delete returns a delete builder for Grant.

func (*GrantClient) DeleteOne

func (c *GrantClient) DeleteOne(gr *Grant) *GrantDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GrantClient) DeleteOneID

func (c *GrantClient) DeleteOneID(id string) *GrantDeleteOne

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

func (*GrantClient) Get

func (c *GrantClient) Get(ctx context.Context, id string) (*Grant, error)

Get returns a Grant entity by its id.

func (*GrantClient) GetX

func (c *GrantClient) GetX(ctx context.Context, id string) *Grant

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

func (*GrantClient) Hooks

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

Hooks returns the client hooks.

func (*GrantClient) Intercept

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

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

func (*GrantClient) Interceptors

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

Interceptors returns the client interceptors.

func (*GrantClient) MapCreateBulk

func (c *GrantClient) MapCreateBulk(slice any, setFunc func(*GrantCreate, int)) *GrantCreateBulk

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 (*GrantClient) Query

func (c *GrantClient) Query() *GrantQuery

Query returns a query builder for Grant.

func (*GrantClient) QueryEntitlement

func (c *GrantClient) QueryEntitlement(gr *Grant) *EntitlementQuery

QueryEntitlement queries the entitlement edge of a Grant.

func (*GrantClient) Update

func (c *GrantClient) Update() *GrantUpdate

Update returns an update builder for Grant.

func (*GrantClient) UpdateOne

func (c *GrantClient) UpdateOne(gr *Grant) *GrantUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GrantClient) UpdateOneID

func (c *GrantClient) UpdateOneID(id string) *GrantUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GrantClient) Use

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

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

type GrantCreate

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

GrantCreate is the builder for creating a Grant entity.

func (*GrantCreate) Exec

func (gc *GrantCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GrantCreate) ExecX

func (gc *GrantCreate) ExecX(ctx context.Context)

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

func (*GrantCreate) Mutation

func (gc *GrantCreate) Mutation() *GrantMutation

Mutation returns the GrantMutation object of the builder.

func (*GrantCreate) OnConflict

func (gc *GrantCreate) OnConflict(opts ...sql.ConflictOption) *GrantUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Grant.Create().
	SetNamespace(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.GrantUpsert) {
		SetNamespace(v+v).
	}).
	Exec(ctx)

func (*GrantCreate) OnConflictColumns

func (gc *GrantCreate) OnConflictColumns(columns ...string) *GrantUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Grant.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*GrantCreate) Save

func (gc *GrantCreate) Save(ctx context.Context) (*Grant, error)

Save creates the Grant in the database.

func (*GrantCreate) SaveX

func (gc *GrantCreate) SaveX(ctx context.Context) *Grant

SaveX calls Save and panics if Save returns an error.

func (*GrantCreate) SetAmount

func (gc *GrantCreate) SetAmount(f float64) *GrantCreate

SetAmount sets the "amount" field.

func (*GrantCreate) SetCreatedAt

func (gc *GrantCreate) SetCreatedAt(t time.Time) *GrantCreate

SetCreatedAt sets the "created_at" field.

func (*GrantCreate) SetDeletedAt

func (gc *GrantCreate) SetDeletedAt(t time.Time) *GrantCreate

SetDeletedAt sets the "deleted_at" field.

func (*GrantCreate) SetEffectiveAt

func (gc *GrantCreate) SetEffectiveAt(t time.Time) *GrantCreate

SetEffectiveAt sets the "effective_at" field.

func (*GrantCreate) SetEntitlement

func (gc *GrantCreate) SetEntitlement(e *Entitlement) *GrantCreate

SetEntitlement sets the "entitlement" edge to the Entitlement entity.

func (*GrantCreate) SetEntitlementID

func (gc *GrantCreate) SetEntitlementID(id string) *GrantCreate

SetEntitlementID sets the "entitlement" edge to the Entitlement entity by ID.

func (*GrantCreate) SetExpiration

func (gc *GrantCreate) SetExpiration(gp grant.ExpirationPeriod) *GrantCreate

SetExpiration sets the "expiration" field.

func (*GrantCreate) SetExpiresAt

func (gc *GrantCreate) SetExpiresAt(t time.Time) *GrantCreate

SetExpiresAt sets the "expires_at" field.

func (*GrantCreate) SetID

func (gc *GrantCreate) SetID(s string) *GrantCreate

SetID sets the "id" field.

func (*GrantCreate) SetMetadata

func (gc *GrantCreate) SetMetadata(m map[string]string) *GrantCreate

SetMetadata sets the "metadata" field.

func (*GrantCreate) SetNamespace

func (gc *GrantCreate) SetNamespace(s string) *GrantCreate

SetNamespace sets the "namespace" field.

func (*GrantCreate) SetNillableCreatedAt

func (gc *GrantCreate) SetNillableCreatedAt(t *time.Time) *GrantCreate

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

func (*GrantCreate) SetNillableDeletedAt

func (gc *GrantCreate) SetNillableDeletedAt(t *time.Time) *GrantCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*GrantCreate) SetNillableID

func (gc *GrantCreate) SetNillableID(s *string) *GrantCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*GrantCreate) SetNillablePriority

func (gc *GrantCreate) SetNillablePriority(u *uint8) *GrantCreate

SetNillablePriority sets the "priority" field if the given value is not nil.

func (*GrantCreate) SetNillableRecurrenceAnchor

func (gc *GrantCreate) SetNillableRecurrenceAnchor(t *time.Time) *GrantCreate

SetNillableRecurrenceAnchor sets the "recurrence_anchor" field if the given value is not nil.

func (*GrantCreate) SetNillableRecurrencePeriod

func (gc *GrantCreate) SetNillableRecurrencePeriod(ri *recurrence.RecurrenceInterval) *GrantCreate

SetNillableRecurrencePeriod sets the "recurrence_period" field if the given value is not nil.

func (*GrantCreate) SetNillableUpdatedAt

func (gc *GrantCreate) SetNillableUpdatedAt(t *time.Time) *GrantCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*GrantCreate) SetNillableVoidedAt

func (gc *GrantCreate) SetNillableVoidedAt(t *time.Time) *GrantCreate

SetNillableVoidedAt sets the "voided_at" field if the given value is not nil.

func (*GrantCreate) SetOwnerID

func (gc *GrantCreate) SetOwnerID(s string) *GrantCreate

SetOwnerID sets the "owner_id" field.

func (*GrantCreate) SetPriority

func (gc *GrantCreate) SetPriority(u uint8) *GrantCreate

SetPriority sets the "priority" field.

func (*GrantCreate) SetRecurrenceAnchor

func (gc *GrantCreate) SetRecurrenceAnchor(t time.Time) *GrantCreate

SetRecurrenceAnchor sets the "recurrence_anchor" field.

func (*GrantCreate) SetRecurrencePeriod

func (gc *GrantCreate) SetRecurrencePeriod(ri recurrence.RecurrenceInterval) *GrantCreate

SetRecurrencePeriod sets the "recurrence_period" field.

func (*GrantCreate) SetResetMaxRollover

func (gc *GrantCreate) SetResetMaxRollover(f float64) *GrantCreate

SetResetMaxRollover sets the "reset_max_rollover" field.

func (*GrantCreate) SetResetMinRollover

func (gc *GrantCreate) SetResetMinRollover(f float64) *GrantCreate

SetResetMinRollover sets the "reset_min_rollover" field.

func (*GrantCreate) SetUpdatedAt

func (gc *GrantCreate) SetUpdatedAt(t time.Time) *GrantCreate

SetUpdatedAt sets the "updated_at" field.

func (*GrantCreate) SetVoidedAt

func (gc *GrantCreate) SetVoidedAt(t time.Time) *GrantCreate

SetVoidedAt sets the "voided_at" field.

type GrantCreateBulk

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

GrantCreateBulk is the builder for creating many Grant entities in bulk.

func (*GrantCreateBulk) Exec

func (gcb *GrantCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GrantCreateBulk) ExecX

func (gcb *GrantCreateBulk) ExecX(ctx context.Context)

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

func (*GrantCreateBulk) OnConflict

func (gcb *GrantCreateBulk) OnConflict(opts ...sql.ConflictOption) *GrantUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Grant.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.GrantUpsert) {
		SetNamespace(v+v).
	}).
	Exec(ctx)

func (*GrantCreateBulk) OnConflictColumns

func (gcb *GrantCreateBulk) OnConflictColumns(columns ...string) *GrantUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Grant.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*GrantCreateBulk) Save

func (gcb *GrantCreateBulk) Save(ctx context.Context) ([]*Grant, error)

Save creates the Grant entities in the database.

func (*GrantCreateBulk) SaveX

func (gcb *GrantCreateBulk) SaveX(ctx context.Context) []*Grant

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

type GrantDelete

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

GrantDelete is the builder for deleting a Grant entity.

func (*GrantDelete) Exec

func (gd *GrantDelete) Exec(ctx context.Context) (int, error)

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

func (*GrantDelete) ExecX

func (gd *GrantDelete) ExecX(ctx context.Context) int

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

func (*GrantDelete) Where

func (gd *GrantDelete) Where(ps ...predicate.Grant) *GrantDelete

Where appends a list predicates to the GrantDelete builder.

type GrantDeleteOne

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

GrantDeleteOne is the builder for deleting a single Grant entity.

func (*GrantDeleteOne) Exec

func (gdo *GrantDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GrantDeleteOne) ExecX

func (gdo *GrantDeleteOne) ExecX(ctx context.Context)

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

func (*GrantDeleteOne) Where

func (gdo *GrantDeleteOne) Where(ps ...predicate.Grant) *GrantDeleteOne

Where appends a list predicates to the GrantDelete builder.

type GrantEdges

type GrantEdges struct {
	// Entitlement holds the value of the entitlement edge.
	Entitlement *Entitlement `json:"entitlement,omitempty"`
	// contains filtered or unexported fields
}

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

func (GrantEdges) EntitlementOrErr

func (e GrantEdges) EntitlementOrErr() (*Entitlement, error)

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

type GrantGroupBy

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

GrantGroupBy is the group-by builder for Grant entities.

func (*GrantGroupBy) Aggregate

func (ggb *GrantGroupBy) Aggregate(fns ...AggregateFunc) *GrantGroupBy

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

func (*GrantGroupBy) Bool

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

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

func (*GrantGroupBy) BoolX

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

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

func (*GrantGroupBy) Bools

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

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

func (*GrantGroupBy) BoolsX

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

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

func (*GrantGroupBy) Float64

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

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

func (*GrantGroupBy) Float64X

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

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

func (*GrantGroupBy) Float64s

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

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

func (*GrantGroupBy) Float64sX

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

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

func (*GrantGroupBy) Int

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

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

func (*GrantGroupBy) IntX

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

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

func (*GrantGroupBy) Ints

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

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

func (*GrantGroupBy) IntsX

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

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

func (*GrantGroupBy) Scan

func (ggb *GrantGroupBy) Scan(ctx context.Context, v any) error

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

func (*GrantGroupBy) ScanX

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

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

func (*GrantGroupBy) String

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

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

func (*GrantGroupBy) StringX

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

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

func (*GrantGroupBy) Strings

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

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

func (*GrantGroupBy) StringsX

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

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

type GrantMutation

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

GrantMutation represents an operation that mutates the Grant nodes in the graph.

func (*GrantMutation) AddAmount

func (m *GrantMutation) AddAmount(f float64)

AddAmount adds f to the "amount" field.

func (*GrantMutation) AddField

func (m *GrantMutation) 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 (*GrantMutation) AddPriority

func (m *GrantMutation) AddPriority(u int8)

AddPriority adds u to the "priority" field.

func (*GrantMutation) AddResetMaxRollover

func (m *GrantMutation) AddResetMaxRollover(f float64)

AddResetMaxRollover adds f to the "reset_max_rollover" field.

func (*GrantMutation) AddResetMinRollover

func (m *GrantMutation) AddResetMinRollover(f float64)

AddResetMinRollover adds f to the "reset_min_rollover" field.

func (*GrantMutation) AddedAmount

func (m *GrantMutation) AddedAmount() (r float64, exists bool)

AddedAmount returns the value that was added to the "amount" field in this mutation.

func (*GrantMutation) AddedEdges

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

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

func (*GrantMutation) AddedField

func (m *GrantMutation) 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 (*GrantMutation) AddedFields

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

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

func (*GrantMutation) AddedIDs

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

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

func (*GrantMutation) AddedPriority

func (m *GrantMutation) AddedPriority() (r int8, exists bool)

AddedPriority returns the value that was added to the "priority" field in this mutation.

func (*GrantMutation) AddedResetMaxRollover

func (m *GrantMutation) AddedResetMaxRollover() (r float64, exists bool)

AddedResetMaxRollover returns the value that was added to the "reset_max_rollover" field in this mutation.

func (*GrantMutation) AddedResetMinRollover

func (m *GrantMutation) AddedResetMinRollover() (r float64, exists bool)

AddedResetMinRollover returns the value that was added to the "reset_min_rollover" field in this mutation.

func (*GrantMutation) Amount

func (m *GrantMutation) Amount() (r float64, exists bool)

Amount returns the value of the "amount" field in the mutation.

func (*GrantMutation) ClearDeletedAt

func (m *GrantMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*GrantMutation) ClearEdge

func (m *GrantMutation) 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 (*GrantMutation) ClearEntitlement

func (m *GrantMutation) ClearEntitlement()

ClearEntitlement clears the "entitlement" edge to the Entitlement entity.

func (*GrantMutation) ClearField

func (m *GrantMutation) 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 (*GrantMutation) ClearMetadata

func (m *GrantMutation) ClearMetadata()

ClearMetadata clears the value of the "metadata" field.

func (*GrantMutation) ClearRecurrenceAnchor

func (m *GrantMutation) ClearRecurrenceAnchor()

ClearRecurrenceAnchor clears the value of the "recurrence_anchor" field.

func (*GrantMutation) ClearRecurrencePeriod

func (m *GrantMutation) ClearRecurrencePeriod()

ClearRecurrencePeriod clears the value of the "recurrence_period" field.

func (*GrantMutation) ClearVoidedAt

func (m *GrantMutation) ClearVoidedAt()

ClearVoidedAt clears the value of the "voided_at" field.

func (*GrantMutation) ClearedEdges

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

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

func (*GrantMutation) ClearedFields

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

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

func (GrantMutation) Client

func (m GrantMutation) 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 (*GrantMutation) CreatedAt

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

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

func (*GrantMutation) DeletedAt

func (m *GrantMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*GrantMutation) DeletedAtCleared

func (m *GrantMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*GrantMutation) EdgeCleared

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

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

func (*GrantMutation) EffectiveAt

func (m *GrantMutation) EffectiveAt() (r time.Time, exists bool)

EffectiveAt returns the value of the "effective_at" field in the mutation.

func (*GrantMutation) EntitlementCleared

func (m *GrantMutation) EntitlementCleared() bool

EntitlementCleared reports if the "entitlement" edge to the Entitlement entity was cleared.

func (*GrantMutation) EntitlementID

func (m *GrantMutation) EntitlementID() (id string, exists bool)

EntitlementID returns the "entitlement" edge ID in the mutation.

func (*GrantMutation) EntitlementIDs

func (m *GrantMutation) EntitlementIDs() (ids []string)

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

func (*GrantMutation) Expiration

func (m *GrantMutation) Expiration() (r grant.ExpirationPeriod, exists bool)

Expiration returns the value of the "expiration" field in the mutation.

func (*GrantMutation) ExpiresAt

func (m *GrantMutation) ExpiresAt() (r time.Time, exists bool)

ExpiresAt returns the value of the "expires_at" field in the mutation.

func (*GrantMutation) Field

func (m *GrantMutation) 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 (*GrantMutation) FieldCleared

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

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

func (*GrantMutation) Fields

func (m *GrantMutation) 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 (*GrantMutation) ID

func (m *GrantMutation) ID() (id string, 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 (*GrantMutation) IDs

func (m *GrantMutation) IDs(ctx context.Context) ([]string, 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 (*GrantMutation) Metadata

func (m *GrantMutation) Metadata() (r map[string]string, exists bool)

Metadata returns the value of the "metadata" field in the mutation.

func (*GrantMutation) MetadataCleared

func (m *GrantMutation) MetadataCleared() bool

MetadataCleared returns if the "metadata" field was cleared in this mutation.

func (*GrantMutation) Namespace

func (m *GrantMutation) Namespace() (r string, exists bool)

Namespace returns the value of the "namespace" field in the mutation.

func (*GrantMutation) OldAmount

func (m *GrantMutation) OldAmount(ctx context.Context) (v float64, err error)

OldAmount returns the old "amount" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldDeletedAt

func (m *GrantMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldEffectiveAt

func (m *GrantMutation) OldEffectiveAt(ctx context.Context) (v time.Time, err error)

OldEffectiveAt returns the old "effective_at" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldExpiration

func (m *GrantMutation) OldExpiration(ctx context.Context) (v grant.ExpirationPeriod, err error)

OldExpiration returns the old "expiration" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldExpiresAt

func (m *GrantMutation) OldExpiresAt(ctx context.Context) (v time.Time, err error)

OldExpiresAt returns the old "expires_at" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldField

func (m *GrantMutation) 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 (*GrantMutation) OldMetadata

func (m *GrantMutation) OldMetadata(ctx context.Context) (v map[string]string, err error)

OldMetadata returns the old "metadata" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldNamespace

func (m *GrantMutation) OldNamespace(ctx context.Context) (v string, err error)

OldNamespace returns the old "namespace" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldOwnerID

func (m *GrantMutation) OldOwnerID(ctx context.Context) (v string, err error)

OldOwnerID returns the old "owner_id" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldPriority

func (m *GrantMutation) OldPriority(ctx context.Context) (v uint8, err error)

OldPriority returns the old "priority" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldRecurrenceAnchor

func (m *GrantMutation) OldRecurrenceAnchor(ctx context.Context) (v *time.Time, err error)

OldRecurrenceAnchor returns the old "recurrence_anchor" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldRecurrencePeriod

func (m *GrantMutation) OldRecurrencePeriod(ctx context.Context) (v *recurrence.RecurrenceInterval, err error)

OldRecurrencePeriod returns the old "recurrence_period" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldResetMaxRollover

func (m *GrantMutation) OldResetMaxRollover(ctx context.Context) (v float64, err error)

OldResetMaxRollover returns the old "reset_max_rollover" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldResetMinRollover

func (m *GrantMutation) OldResetMinRollover(ctx context.Context) (v float64, err error)

OldResetMinRollover returns the old "reset_min_rollover" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldUpdatedAt

func (m *GrantMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldVoidedAt

func (m *GrantMutation) OldVoidedAt(ctx context.Context) (v *time.Time, err error)

OldVoidedAt returns the old "voided_at" field's value of the Grant entity. If the Grant 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 (*GrantMutation) Op

func (m *GrantMutation) Op() Op

Op returns the operation name.

func (*GrantMutation) OwnerID

func (m *GrantMutation) OwnerID() (r string, exists bool)

OwnerID returns the value of the "owner_id" field in the mutation.

func (*GrantMutation) Priority

func (m *GrantMutation) Priority() (r uint8, exists bool)

Priority returns the value of the "priority" field in the mutation.

func (*GrantMutation) RecurrenceAnchor

func (m *GrantMutation) RecurrenceAnchor() (r time.Time, exists bool)

RecurrenceAnchor returns the value of the "recurrence_anchor" field in the mutation.

func (*GrantMutation) RecurrenceAnchorCleared

func (m *GrantMutation) RecurrenceAnchorCleared() bool

RecurrenceAnchorCleared returns if the "recurrence_anchor" field was cleared in this mutation.

func (*GrantMutation) RecurrencePeriod

func (m *GrantMutation) RecurrencePeriod() (r recurrence.RecurrenceInterval, exists bool)

RecurrencePeriod returns the value of the "recurrence_period" field in the mutation.

func (*GrantMutation) RecurrencePeriodCleared

func (m *GrantMutation) RecurrencePeriodCleared() bool

RecurrencePeriodCleared returns if the "recurrence_period" field was cleared in this mutation.

func (*GrantMutation) RemovedEdges

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

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

func (*GrantMutation) RemovedIDs

func (m *GrantMutation) 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 (*GrantMutation) ResetAmount

func (m *GrantMutation) ResetAmount()

ResetAmount resets all changes to the "amount" field.

func (*GrantMutation) ResetCreatedAt

func (m *GrantMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*GrantMutation) ResetDeletedAt

func (m *GrantMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*GrantMutation) ResetEdge

func (m *GrantMutation) 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 (*GrantMutation) ResetEffectiveAt

func (m *GrantMutation) ResetEffectiveAt()

ResetEffectiveAt resets all changes to the "effective_at" field.

func (*GrantMutation) ResetEntitlement

func (m *GrantMutation) ResetEntitlement()

ResetEntitlement resets all changes to the "entitlement" edge.

func (*GrantMutation) ResetExpiration

func (m *GrantMutation) ResetExpiration()

ResetExpiration resets all changes to the "expiration" field.

func (*GrantMutation) ResetExpiresAt

func (m *GrantMutation) ResetExpiresAt()

ResetExpiresAt resets all changes to the "expires_at" field.

func (*GrantMutation) ResetField

func (m *GrantMutation) 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 (*GrantMutation) ResetMaxRollover

func (m *GrantMutation) ResetMaxRollover() (r float64, exists bool)

ResetMaxRollover returns the value of the "reset_max_rollover" field in the mutation.

func (*GrantMutation) ResetMetadata

func (m *GrantMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" field.

func (*GrantMutation) ResetMinRollover

func (m *GrantMutation) ResetMinRollover() (r float64, exists bool)

ResetMinRollover returns the value of the "reset_min_rollover" field in the mutation.

func (*GrantMutation) ResetNamespace

func (m *GrantMutation) ResetNamespace()

ResetNamespace resets all changes to the "namespace" field.

func (*GrantMutation) ResetOwnerID

func (m *GrantMutation) ResetOwnerID()

ResetOwnerID resets all changes to the "owner_id" field.

func (*GrantMutation) ResetPriority

func (m *GrantMutation) ResetPriority()

ResetPriority resets all changes to the "priority" field.

func (*GrantMutation) ResetRecurrenceAnchor

func (m *GrantMutation) ResetRecurrenceAnchor()

ResetRecurrenceAnchor resets all changes to the "recurrence_anchor" field.

func (*GrantMutation) ResetRecurrencePeriod

func (m *GrantMutation) ResetRecurrencePeriod()

ResetRecurrencePeriod resets all changes to the "recurrence_period" field.

func (*GrantMutation) ResetResetMaxRollover

func (m *GrantMutation) ResetResetMaxRollover()

ResetResetMaxRollover resets all changes to the "reset_max_rollover" field.

func (*GrantMutation) ResetResetMinRollover

func (m *GrantMutation) ResetResetMinRollover()

ResetResetMinRollover resets all changes to the "reset_min_rollover" field.

func (*GrantMutation) ResetUpdatedAt

func (m *GrantMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*GrantMutation) ResetVoidedAt

func (m *GrantMutation) ResetVoidedAt()

ResetVoidedAt resets all changes to the "voided_at" field.

func (*GrantMutation) SetAmount

func (m *GrantMutation) SetAmount(f float64)

SetAmount sets the "amount" field.

func (*GrantMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*GrantMutation) SetDeletedAt

func (m *GrantMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*GrantMutation) SetEffectiveAt

func (m *GrantMutation) SetEffectiveAt(t time.Time)

SetEffectiveAt sets the "effective_at" field.

func (*GrantMutation) SetEntitlementID

func (m *GrantMutation) SetEntitlementID(id string)

SetEntitlementID sets the "entitlement" edge to the Entitlement entity by id.

func (*GrantMutation) SetExpiration

func (m *GrantMutation) SetExpiration(gp grant.ExpirationPeriod)

SetExpiration sets the "expiration" field.

func (*GrantMutation) SetExpiresAt

func (m *GrantMutation) SetExpiresAt(t time.Time)

SetExpiresAt sets the "expires_at" field.

func (*GrantMutation) SetField

func (m *GrantMutation) 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 (*GrantMutation) SetID

func (m *GrantMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Grant entities.

func (*GrantMutation) SetMetadata

func (m *GrantMutation) SetMetadata(value map[string]string)

SetMetadata sets the "metadata" field.

func (*GrantMutation) SetNamespace

func (m *GrantMutation) SetNamespace(s string)

SetNamespace sets the "namespace" field.

func (*GrantMutation) SetOp

func (m *GrantMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GrantMutation) SetOwnerID

func (m *GrantMutation) SetOwnerID(s string)

SetOwnerID sets the "owner_id" field.

func (*GrantMutation) SetPriority

func (m *GrantMutation) SetPriority(u uint8)

SetPriority sets the "priority" field.

func (*GrantMutation) SetRecurrenceAnchor

func (m *GrantMutation) SetRecurrenceAnchor(t time.Time)

SetRecurrenceAnchor sets the "recurrence_anchor" field.

func (*GrantMutation) SetRecurrencePeriod

func (m *GrantMutation) SetRecurrencePeriod(ri recurrence.RecurrenceInterval)

SetRecurrencePeriod sets the "recurrence_period" field.

func (*GrantMutation) SetResetMaxRollover

func (m *GrantMutation) SetResetMaxRollover(f float64)

SetResetMaxRollover sets the "reset_max_rollover" field.

func (*GrantMutation) SetResetMinRollover

func (m *GrantMutation) SetResetMinRollover(f float64)

SetResetMinRollover sets the "reset_min_rollover" field.

func (*GrantMutation) SetUpdatedAt

func (m *GrantMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*GrantMutation) SetVoidedAt

func (m *GrantMutation) SetVoidedAt(t time.Time)

SetVoidedAt sets the "voided_at" field.

func (GrantMutation) Tx

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

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

func (*GrantMutation) Type

func (m *GrantMutation) Type() string

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

func (*GrantMutation) UpdatedAt

func (m *GrantMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*GrantMutation) VoidedAt

func (m *GrantMutation) VoidedAt() (r time.Time, exists bool)

VoidedAt returns the value of the "voided_at" field in the mutation.

func (*GrantMutation) VoidedAtCleared

func (m *GrantMutation) VoidedAtCleared() bool

VoidedAtCleared returns if the "voided_at" field was cleared in this mutation.

func (*GrantMutation) Where

func (m *GrantMutation) Where(ps ...predicate.Grant)

Where appends a list predicates to the GrantMutation builder.

func (*GrantMutation) WhereP

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

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

type GrantQuery

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

GrantQuery is the builder for querying Grant entities.

func (*GrantQuery) Aggregate

func (gq *GrantQuery) Aggregate(fns ...AggregateFunc) *GrantSelect

Aggregate returns a GrantSelect configured with the given aggregations.

func (*GrantQuery) All

func (gq *GrantQuery) All(ctx context.Context) ([]*Grant, error)

All executes the query and returns a list of Grants.

func (*GrantQuery) AllX

func (gq *GrantQuery) AllX(ctx context.Context) []*Grant

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

func (*GrantQuery) Clone

func (gq *GrantQuery) Clone() *GrantQuery

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

func (*GrantQuery) Count

func (gq *GrantQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GrantQuery) CountX

func (gq *GrantQuery) CountX(ctx context.Context) int

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

func (*GrantQuery) Exist

func (gq *GrantQuery) Exist(ctx context.Context) (bool, error)

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

func (*GrantQuery) ExistX

func (gq *GrantQuery) ExistX(ctx context.Context) bool

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

func (*GrantQuery) First

func (gq *GrantQuery) First(ctx context.Context) (*Grant, error)

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

func (*GrantQuery) FirstID

func (gq *GrantQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*GrantQuery) FirstIDX

func (gq *GrantQuery) FirstIDX(ctx context.Context) string

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

func (*GrantQuery) FirstX

func (gq *GrantQuery) FirstX(ctx context.Context) *Grant

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

func (*GrantQuery) ForShare

func (gq *GrantQuery) ForShare(opts ...sql.LockOption) *GrantQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*GrantQuery) ForUpdate

func (gq *GrantQuery) ForUpdate(opts ...sql.LockOption) *GrantQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*GrantQuery) GroupBy

func (gq *GrantQuery) GroupBy(field string, fields ...string) *GrantGroupBy

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 {
	Namespace string `json:"namespace,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Grant.Query().
	GroupBy(dbgrant.FieldNamespace).
	Aggregate(db.Count()).
	Scan(ctx, &v)

func (*GrantQuery) IDs

func (gq *GrantQuery) IDs(ctx context.Context) (ids []string, err error)

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

func (*GrantQuery) IDsX

func (gq *GrantQuery) IDsX(ctx context.Context) []string

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

func (*GrantQuery) Limit

func (gq *GrantQuery) Limit(limit int) *GrantQuery

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

func (*GrantQuery) Offset

func (gq *GrantQuery) Offset(offset int) *GrantQuery

Offset to start from.

func (*GrantQuery) Only

func (gq *GrantQuery) Only(ctx context.Context) (*Grant, error)

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

func (*GrantQuery) OnlyID

func (gq *GrantQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*GrantQuery) OnlyIDX

func (gq *GrantQuery) OnlyIDX(ctx context.Context) string

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

func (*GrantQuery) OnlyX

func (gq *GrantQuery) OnlyX(ctx context.Context) *Grant

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

func (*GrantQuery) Order

func (gq *GrantQuery) Order(o ...dbgrant.OrderOption) *GrantQuery

Order specifies how the records should be ordered.

func (*GrantQuery) Paginate

Paginate runs the query and returns a paginated response. If page is its 0 value then it will return all the items and populate the response page accordingly.

func (*GrantQuery) QueryEntitlement

func (gq *GrantQuery) QueryEntitlement() *EntitlementQuery

QueryEntitlement chains the current query on the "entitlement" edge.

func (*GrantQuery) Select

func (gq *GrantQuery) Select(fields ...string) *GrantSelect

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 {
	Namespace string `json:"namespace,omitempty"`
}

client.Grant.Query().
	Select(dbgrant.FieldNamespace).
	Scan(ctx, &v)

func (*GrantQuery) Unique

func (gq *GrantQuery) Unique(unique bool) *GrantQuery

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 (*GrantQuery) Where

func (gq *GrantQuery) Where(ps ...predicate.Grant) *GrantQuery

Where adds a new predicate for the GrantQuery builder.

func (*GrantQuery) WithEntitlement

func (gq *GrantQuery) WithEntitlement(opts ...func(*EntitlementQuery)) *GrantQuery

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

type GrantSelect

type GrantSelect struct {
	*GrantQuery
	// contains filtered or unexported fields
}

GrantSelect is the builder for selecting fields of Grant entities.

func (*GrantSelect) Aggregate

func (gs *GrantSelect) Aggregate(fns ...AggregateFunc) *GrantSelect

Aggregate adds the given aggregation functions to the selector query.

func (*GrantSelect) Bool

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

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

func (*GrantSelect) BoolX

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

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

func (*GrantSelect) Bools

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

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

func (*GrantSelect) BoolsX

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

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

func (*GrantSelect) Float64

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

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

func (*GrantSelect) Float64X

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

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

func (*GrantSelect) Float64s

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

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

func (*GrantSelect) Float64sX

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

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

func (*GrantSelect) Int

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

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

func (*GrantSelect) IntX

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

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

func (*GrantSelect) Ints

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

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

func (*GrantSelect) IntsX

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

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

func (*GrantSelect) Scan

func (gs *GrantSelect) Scan(ctx context.Context, v any) error

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

func (*GrantSelect) ScanX

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

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

func (*GrantSelect) String

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

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

func (*GrantSelect) StringX

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

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

func (*GrantSelect) Strings

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

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

func (*GrantSelect) StringsX

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

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

type GrantUpdate

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

GrantUpdate is the builder for updating Grant entities.

func (*GrantUpdate) ClearDeletedAt

func (gu *GrantUpdate) ClearDeletedAt() *GrantUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*GrantUpdate) ClearMetadata

func (gu *GrantUpdate) ClearMetadata() *GrantUpdate

ClearMetadata clears the value of the "metadata" field.

func (*GrantUpdate) ClearVoidedAt

func (gu *GrantUpdate) ClearVoidedAt() *GrantUpdate

ClearVoidedAt clears the value of the "voided_at" field.

func (*GrantUpdate) Exec

func (gu *GrantUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GrantUpdate) ExecX

func (gu *GrantUpdate) ExecX(ctx context.Context)

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

func (*GrantUpdate) Mutation

func (gu *GrantUpdate) Mutation() *GrantMutation

Mutation returns the GrantMutation object of the builder.

func (*GrantUpdate) Save

func (gu *GrantUpdate) Save(ctx context.Context) (int, error)

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

func (*GrantUpdate) SaveX

func (gu *GrantUpdate) SaveX(ctx context.Context) int

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

func (*GrantUpdate) SetDeletedAt

func (gu *GrantUpdate) SetDeletedAt(t time.Time) *GrantUpdate

SetDeletedAt sets the "deleted_at" field.

func (*GrantUpdate) SetMetadata

func (gu *GrantUpdate) SetMetadata(m map[string]string) *GrantUpdate

SetMetadata sets the "metadata" field.

func (*GrantUpdate) SetNillableDeletedAt

func (gu *GrantUpdate) SetNillableDeletedAt(t *time.Time) *GrantUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*GrantUpdate) SetNillableVoidedAt

func (gu *GrantUpdate) SetNillableVoidedAt(t *time.Time) *GrantUpdate

SetNillableVoidedAt sets the "voided_at" field if the given value is not nil.

func (*GrantUpdate) SetUpdatedAt

func (gu *GrantUpdate) SetUpdatedAt(t time.Time) *GrantUpdate

SetUpdatedAt sets the "updated_at" field.

func (*GrantUpdate) SetVoidedAt

func (gu *GrantUpdate) SetVoidedAt(t time.Time) *GrantUpdate

SetVoidedAt sets the "voided_at" field.

func (*GrantUpdate) Where

func (gu *GrantUpdate) Where(ps ...predicate.Grant) *GrantUpdate

Where appends a list predicates to the GrantUpdate builder.

type GrantUpdateOne

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

GrantUpdateOne is the builder for updating a single Grant entity.

func (*GrantUpdateOne) ClearDeletedAt

func (guo *GrantUpdateOne) ClearDeletedAt() *GrantUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*GrantUpdateOne) ClearMetadata

func (guo *GrantUpdateOne) ClearMetadata() *GrantUpdateOne

ClearMetadata clears the value of the "metadata" field.

func (*GrantUpdateOne) ClearVoidedAt

func (guo *GrantUpdateOne) ClearVoidedAt() *GrantUpdateOne

ClearVoidedAt clears the value of the "voided_at" field.

func (*GrantUpdateOne) Exec

func (guo *GrantUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GrantUpdateOne) ExecX

func (guo *GrantUpdateOne) ExecX(ctx context.Context)

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

func (*GrantUpdateOne) Mutation

func (guo *GrantUpdateOne) Mutation() *GrantMutation

Mutation returns the GrantMutation object of the builder.

func (*GrantUpdateOne) Save

func (guo *GrantUpdateOne) Save(ctx context.Context) (*Grant, error)

Save executes the query and returns the updated Grant entity.

func (*GrantUpdateOne) SaveX

func (guo *GrantUpdateOne) SaveX(ctx context.Context) *Grant

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

func (*GrantUpdateOne) Select

func (guo *GrantUpdateOne) Select(field string, fields ...string) *GrantUpdateOne

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

func (*GrantUpdateOne) SetDeletedAt

func (guo *GrantUpdateOne) SetDeletedAt(t time.Time) *GrantUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*GrantUpdateOne) SetMetadata

func (guo *GrantUpdateOne) SetMetadata(m map[string]string) *GrantUpdateOne

SetMetadata sets the "metadata" field.

func (*GrantUpdateOne) SetNillableDeletedAt

func (guo *GrantUpdateOne) SetNillableDeletedAt(t *time.Time) *GrantUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*GrantUpdateOne) SetNillableVoidedAt

func (guo *GrantUpdateOne) SetNillableVoidedAt(t *time.Time) *GrantUpdateOne

SetNillableVoidedAt sets the "voided_at" field if the given value is not nil.

func (*GrantUpdateOne) SetUpdatedAt

func (guo *GrantUpdateOne) SetUpdatedAt(t time.Time) *GrantUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*GrantUpdateOne) SetVoidedAt

func (guo *GrantUpdateOne) SetVoidedAt(t time.Time) *GrantUpdateOne

SetVoidedAt sets the "voided_at" field.

func (*GrantUpdateOne) Where

func (guo *GrantUpdateOne) Where(ps ...predicate.Grant) *GrantUpdateOne

Where appends a list predicates to the GrantUpdate builder.

type GrantUpsert

type GrantUpsert struct {
	*sql.UpdateSet
}

GrantUpsert is the "OnConflict" setter.

func (*GrantUpsert) ClearDeletedAt

func (u *GrantUpsert) ClearDeletedAt() *GrantUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*GrantUpsert) ClearMetadata

func (u *GrantUpsert) ClearMetadata() *GrantUpsert

ClearMetadata clears the value of the "metadata" field.

func (*GrantUpsert) ClearVoidedAt

func (u *GrantUpsert) ClearVoidedAt() *GrantUpsert

ClearVoidedAt clears the value of the "voided_at" field.

func (*GrantUpsert) SetDeletedAt

func (u *GrantUpsert) SetDeletedAt(v time.Time) *GrantUpsert

SetDeletedAt sets the "deleted_at" field.

func (*GrantUpsert) SetMetadata

func (u *GrantUpsert) SetMetadata(v map[string]string) *GrantUpsert

SetMetadata sets the "metadata" field.

func (*GrantUpsert) SetUpdatedAt

func (u *GrantUpsert) SetUpdatedAt(v time.Time) *GrantUpsert

SetUpdatedAt sets the "updated_at" field.

func (*GrantUpsert) SetVoidedAt

func (u *GrantUpsert) SetVoidedAt(v time.Time) *GrantUpsert

SetVoidedAt sets the "voided_at" field.

func (*GrantUpsert) UpdateDeletedAt

func (u *GrantUpsert) UpdateDeletedAt() *GrantUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*GrantUpsert) UpdateMetadata

func (u *GrantUpsert) UpdateMetadata() *GrantUpsert

UpdateMetadata sets the "metadata" field to the value that was provided on create.

func (*GrantUpsert) UpdateUpdatedAt

func (u *GrantUpsert) UpdateUpdatedAt() *GrantUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*GrantUpsert) UpdateVoidedAt

func (u *GrantUpsert) UpdateVoidedAt() *GrantUpsert

UpdateVoidedAt sets the "voided_at" field to the value that was provided on create.

type GrantUpsertBulk

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

GrantUpsertBulk is the builder for "upsert"-ing a bulk of Grant nodes.

func (*GrantUpsertBulk) ClearDeletedAt

func (u *GrantUpsertBulk) ClearDeletedAt() *GrantUpsertBulk

ClearDeletedAt clears the value of the "deleted_at" field.

func (*GrantUpsertBulk) ClearMetadata

func (u *GrantUpsertBulk) ClearMetadata() *GrantUpsertBulk

ClearMetadata clears the value of the "metadata" field.

func (*GrantUpsertBulk) ClearVoidedAt

func (u *GrantUpsertBulk) ClearVoidedAt() *GrantUpsertBulk

ClearVoidedAt clears the value of the "voided_at" field.

func (*GrantUpsertBulk) DoNothing

func (u *GrantUpsertBulk) DoNothing() *GrantUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*GrantUpsertBulk) Exec

func (u *GrantUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GrantUpsertBulk) ExecX

func (u *GrantUpsertBulk) ExecX(ctx context.Context)

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

func (*GrantUpsertBulk) Ignore

func (u *GrantUpsertBulk) Ignore() *GrantUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Grant.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*GrantUpsertBulk) SetDeletedAt

func (u *GrantUpsertBulk) SetDeletedAt(v time.Time) *GrantUpsertBulk

SetDeletedAt sets the "deleted_at" field.

func (*GrantUpsertBulk) SetMetadata

func (u *GrantUpsertBulk) SetMetadata(v map[string]string) *GrantUpsertBulk

SetMetadata sets the "metadata" field.

func (*GrantUpsertBulk) SetUpdatedAt

func (u *GrantUpsertBulk) SetUpdatedAt(v time.Time) *GrantUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*GrantUpsertBulk) SetVoidedAt

func (u *GrantUpsertBulk) SetVoidedAt(v time.Time) *GrantUpsertBulk

SetVoidedAt sets the "voided_at" field.

func (*GrantUpsertBulk) Update

func (u *GrantUpsertBulk) Update(set func(*GrantUpsert)) *GrantUpsertBulk

Update allows overriding fields `UPDATE` values. See the GrantCreateBulk.OnConflict documentation for more info.

func (*GrantUpsertBulk) UpdateDeletedAt

func (u *GrantUpsertBulk) UpdateDeletedAt() *GrantUpsertBulk

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*GrantUpsertBulk) UpdateMetadata

func (u *GrantUpsertBulk) UpdateMetadata() *GrantUpsertBulk

UpdateMetadata sets the "metadata" field to the value that was provided on create.

func (*GrantUpsertBulk) UpdateNewValues

func (u *GrantUpsertBulk) UpdateNewValues() *GrantUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Grant.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(dbgrant.FieldID)
		}),
	).
	Exec(ctx)

func (*GrantUpsertBulk) UpdateUpdatedAt

func (u *GrantUpsertBulk) UpdateUpdatedAt() *GrantUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*GrantUpsertBulk) UpdateVoidedAt

func (u *GrantUpsertBulk) UpdateVoidedAt() *GrantUpsertBulk

UpdateVoidedAt sets the "voided_at" field to the value that was provided on create.

type GrantUpsertOne

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

GrantUpsertOne is the builder for "upsert"-ing

one Grant node.

func (*GrantUpsertOne) ClearDeletedAt

func (u *GrantUpsertOne) ClearDeletedAt() *GrantUpsertOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*GrantUpsertOne) ClearMetadata

func (u *GrantUpsertOne) ClearMetadata() *GrantUpsertOne

ClearMetadata clears the value of the "metadata" field.

func (*GrantUpsertOne) ClearVoidedAt

func (u *GrantUpsertOne) ClearVoidedAt() *GrantUpsertOne

ClearVoidedAt clears the value of the "voided_at" field.

func (*GrantUpsertOne) DoNothing

func (u *GrantUpsertOne) DoNothing() *GrantUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*GrantUpsertOne) Exec

func (u *GrantUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*GrantUpsertOne) ExecX

func (u *GrantUpsertOne) ExecX(ctx context.Context)

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

func (*GrantUpsertOne) ID

func (u *GrantUpsertOne) ID(ctx context.Context) (id string, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*GrantUpsertOne) IDX

func (u *GrantUpsertOne) IDX(ctx context.Context) string

IDX is like ID, but panics if an error occurs.

func (*GrantUpsertOne) Ignore

func (u *GrantUpsertOne) Ignore() *GrantUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Grant.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*GrantUpsertOne) SetDeletedAt

func (u *GrantUpsertOne) SetDeletedAt(v time.Time) *GrantUpsertOne

SetDeletedAt sets the "deleted_at" field.

func (*GrantUpsertOne) SetMetadata

func (u *GrantUpsertOne) SetMetadata(v map[string]string) *GrantUpsertOne

SetMetadata sets the "metadata" field.

func (*GrantUpsertOne) SetUpdatedAt

func (u *GrantUpsertOne) SetUpdatedAt(v time.Time) *GrantUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*GrantUpsertOne) SetVoidedAt

func (u *GrantUpsertOne) SetVoidedAt(v time.Time) *GrantUpsertOne

SetVoidedAt sets the "voided_at" field.

func (*GrantUpsertOne) Update

func (u *GrantUpsertOne) Update(set func(*GrantUpsert)) *GrantUpsertOne

Update allows overriding fields `UPDATE` values. See the GrantCreate.OnConflict documentation for more info.

func (*GrantUpsertOne) UpdateDeletedAt

func (u *GrantUpsertOne) UpdateDeletedAt() *GrantUpsertOne

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*GrantUpsertOne) UpdateMetadata

func (u *GrantUpsertOne) UpdateMetadata() *GrantUpsertOne

UpdateMetadata sets the "metadata" field to the value that was provided on create.

func (*GrantUpsertOne) UpdateNewValues

func (u *GrantUpsertOne) UpdateNewValues() *GrantUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Grant.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(dbgrant.FieldID)
		}),
	).
	Exec(ctx)

func (*GrantUpsertOne) UpdateUpdatedAt

func (u *GrantUpsertOne) UpdateUpdatedAt() *GrantUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*GrantUpsertOne) UpdateVoidedAt

func (u *GrantUpsertOne) UpdateVoidedAt() *GrantUpsertOne

UpdateVoidedAt sets the "voided_at" field to the value that was provided on create.

type Grants

type Grants []*Grant

Grants is a parsable slice of Grant.

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 NotificationChannel

type NotificationChannel struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// Namespace holds the value of the "namespace" field.
	Namespace string `json:"namespace,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"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// Type holds the value of the "type" field.
	Type notification.ChannelType `json:"type,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Disabled holds the value of the "disabled" field.
	Disabled bool `json:"disabled,omitempty"`
	// Config holds the value of the "config" field.
	Config notification.ChannelConfig `json:"config,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the NotificationChannelQuery when eager-loading is set.
	Edges NotificationChannelEdges `json:"edges"`
	// contains filtered or unexported fields
}

NotificationChannel is the model entity for the NotificationChannel schema.

func (*NotificationChannel) QueryRules

func (nc *NotificationChannel) QueryRules() *NotificationRuleQuery

QueryRules queries the "rules" edge of the NotificationChannel entity.

func (*NotificationChannel) String

func (nc *NotificationChannel) String() string

String implements the fmt.Stringer.

func (*NotificationChannel) Unwrap

Unwrap unwraps the NotificationChannel 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 (*NotificationChannel) Update

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

func (*NotificationChannel) Value

func (nc *NotificationChannel) Value(name string) (ent.Value, error)

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

type NotificationChannelClient

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

NotificationChannelClient is a client for the NotificationChannel schema.

func NewNotificationChannelClient

func NewNotificationChannelClient(c config) *NotificationChannelClient

NewNotificationChannelClient returns a client for the NotificationChannel from the given config.

func (*NotificationChannelClient) Create

Create returns a builder for creating a NotificationChannel entity.

func (*NotificationChannelClient) CreateBulk

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

func (*NotificationChannelClient) Delete

Delete returns a delete builder for NotificationChannel.

func (*NotificationChannelClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*NotificationChannelClient) DeleteOneID

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

func (*NotificationChannelClient) Get

Get returns a NotificationChannel entity by its id.

func (*NotificationChannelClient) GetX

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

func (*NotificationChannelClient) Hooks

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

Hooks returns the client hooks.

func (*NotificationChannelClient) Intercept

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

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

func (*NotificationChannelClient) Interceptors

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

Interceptors returns the client interceptors.

func (*NotificationChannelClient) MapCreateBulk

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 (*NotificationChannelClient) Query

Query returns a query builder for NotificationChannel.

func (*NotificationChannelClient) QueryRules

QueryRules queries the rules edge of a NotificationChannel.

func (*NotificationChannelClient) Update

Update returns an update builder for NotificationChannel.

func (*NotificationChannelClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*NotificationChannelClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*NotificationChannelClient) Use

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

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

type NotificationChannelCreate

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

NotificationChannelCreate is the builder for creating a NotificationChannel entity.

func (*NotificationChannelCreate) AddRuleIDs

AddRuleIDs adds the "rules" edge to the NotificationRule entity by IDs.

func (*NotificationChannelCreate) AddRules

AddRules adds the "rules" edges to the NotificationRule entity.

func (*NotificationChannelCreate) Exec

Exec executes the query.

func (*NotificationChannelCreate) ExecX

func (ncc *NotificationChannelCreate) ExecX(ctx context.Context)

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

func (*NotificationChannelCreate) Mutation

Mutation returns the NotificationChannelMutation object of the builder.

func (*NotificationChannelCreate) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.NotificationChannel.Create().
	SetNamespace(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.NotificationChannelUpsert) {
		SetNamespace(v+v).
	}).
	Exec(ctx)

func (*NotificationChannelCreate) OnConflictColumns

func (ncc *NotificationChannelCreate) OnConflictColumns(columns ...string) *NotificationChannelUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.NotificationChannel.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*NotificationChannelCreate) Save

Save creates the NotificationChannel in the database.

func (*NotificationChannelCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*NotificationChannelCreate) SetConfig

SetConfig sets the "config" field.

func (*NotificationChannelCreate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*NotificationChannelCreate) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*NotificationChannelCreate) SetDisabled

SetDisabled sets the "disabled" field.

func (*NotificationChannelCreate) SetID

SetID sets the "id" field.

func (*NotificationChannelCreate) SetName

SetName sets the "name" field.

func (*NotificationChannelCreate) SetNamespace

SetNamespace sets the "namespace" field.

func (*NotificationChannelCreate) SetNillableCreatedAt

func (ncc *NotificationChannelCreate) SetNillableCreatedAt(t *time.Time) *NotificationChannelCreate

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

func (*NotificationChannelCreate) SetNillableDeletedAt

func (ncc *NotificationChannelCreate) SetNillableDeletedAt(t *time.Time) *NotificationChannelCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*NotificationChannelCreate) SetNillableDisabled

func (ncc *NotificationChannelCreate) SetNillableDisabled(b *bool) *NotificationChannelCreate

SetNillableDisabled sets the "disabled" field if the given value is not nil.

func (*NotificationChannelCreate) SetNillableID

SetNillableID sets the "id" field if the given value is not nil.

func (*NotificationChannelCreate) SetNillableUpdatedAt

func (ncc *NotificationChannelCreate) SetNillableUpdatedAt(t *time.Time) *NotificationChannelCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*NotificationChannelCreate) SetType

SetType sets the "type" field.

func (*NotificationChannelCreate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

type NotificationChannelCreateBulk

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

NotificationChannelCreateBulk is the builder for creating many NotificationChannel entities in bulk.

func (*NotificationChannelCreateBulk) Exec

Exec executes the query.

func (*NotificationChannelCreateBulk) ExecX

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

func (*NotificationChannelCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.NotificationChannel.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.NotificationChannelUpsert) {
		SetNamespace(v+v).
	}).
	Exec(ctx)

func (*NotificationChannelCreateBulk) OnConflictColumns

func (nccb *NotificationChannelCreateBulk) OnConflictColumns(columns ...string) *NotificationChannelUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.NotificationChannel.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*NotificationChannelCreateBulk) Save

Save creates the NotificationChannel entities in the database.

func (*NotificationChannelCreateBulk) SaveX

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

type NotificationChannelDelete

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

NotificationChannelDelete is the builder for deleting a NotificationChannel entity.

func (*NotificationChannelDelete) Exec

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

func (*NotificationChannelDelete) ExecX

func (ncd *NotificationChannelDelete) ExecX(ctx context.Context) int

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

func (*NotificationChannelDelete) Where

Where appends a list predicates to the NotificationChannelDelete builder.

type NotificationChannelDeleteOne

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

NotificationChannelDeleteOne is the builder for deleting a single NotificationChannel entity.

func (*NotificationChannelDeleteOne) Exec

Exec executes the deletion query.

func (*NotificationChannelDeleteOne) ExecX

func (ncdo *NotificationChannelDeleteOne) ExecX(ctx context.Context)

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

func (*NotificationChannelDeleteOne) Where

Where appends a list predicates to the NotificationChannelDelete builder.

type NotificationChannelEdges

type NotificationChannelEdges struct {
	// Rules holds the value of the rules edge.
	Rules []*NotificationRule `json:"rules,omitempty"`
	// contains filtered or unexported fields
}

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

func (NotificationChannelEdges) RulesOrErr

func (e NotificationChannelEdges) RulesOrErr() ([]*NotificationRule, error)

RulesOrErr returns the Rules value or an error if the edge was not loaded in eager-loading.

type NotificationChannelGroupBy

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

NotificationChannelGroupBy is the group-by builder for NotificationChannel entities.

func (*NotificationChannelGroupBy) Aggregate

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

func (*NotificationChannelGroupBy) Bool

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

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

func (*NotificationChannelGroupBy) BoolX

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

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

func (*NotificationChannelGroupBy) Bools

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

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

func (*NotificationChannelGroupBy) BoolsX

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

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

func (*NotificationChannelGroupBy) Float64

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

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

func (*NotificationChannelGroupBy) Float64X

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

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

func (*NotificationChannelGroupBy) Float64s

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

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

func (*NotificationChannelGroupBy) Float64sX

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

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

func (*NotificationChannelGroupBy) Int

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

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

func (*NotificationChannelGroupBy) IntX

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

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

func (*NotificationChannelGroupBy) Ints

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

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

func (*NotificationChannelGroupBy) IntsX

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

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

func (*NotificationChannelGroupBy) Scan

func (ncgb *NotificationChannelGroupBy) Scan(ctx context.Context, v any) error

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

func (*NotificationChannelGroupBy) ScanX

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

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

func (*NotificationChannelGroupBy) String

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

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

func (*NotificationChannelGroupBy) StringX

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

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

func (*NotificationChannelGroupBy) Strings

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

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

func (*NotificationChannelGroupBy) StringsX

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

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

type NotificationChannelMutation

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

NotificationChannelMutation represents an operation that mutates the NotificationChannel nodes in the graph.

func (*NotificationChannelMutation) AddField

func (m *NotificationChannelMutation) 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 (*NotificationChannelMutation) AddRuleIDs

func (m *NotificationChannelMutation) AddRuleIDs(ids ...string)

AddRuleIDs adds the "rules" edge to the NotificationRule entity by ids.

func (*NotificationChannelMutation) AddedEdges

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

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

func (*NotificationChannelMutation) AddedField

func (m *NotificationChannelMutation) 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 (*NotificationChannelMutation) AddedFields

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

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

func (*NotificationChannelMutation) AddedIDs

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

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

func (*NotificationChannelMutation) ClearDeletedAt

func (m *NotificationChannelMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*NotificationChannelMutation) ClearDisabled

func (m *NotificationChannelMutation) ClearDisabled()

ClearDisabled clears the value of the "disabled" field.

func (*NotificationChannelMutation) ClearEdge

func (m *NotificationChannelMutation) 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 (*NotificationChannelMutation) ClearField

func (m *NotificationChannelMutation) 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 (*NotificationChannelMutation) ClearRules

func (m *NotificationChannelMutation) ClearRules()

ClearRules clears the "rules" edge to the NotificationRule entity.

func (*NotificationChannelMutation) ClearedEdges

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

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

func (*NotificationChannelMutation) ClearedFields

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

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

func (NotificationChannelMutation) Client

func (m NotificationChannelMutation) 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 (*NotificationChannelMutation) Config

Config returns the value of the "config" field in the mutation.

func (*NotificationChannelMutation) CreatedAt

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

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

func (*NotificationChannelMutation) DeletedAt

func (m *NotificationChannelMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*NotificationChannelMutation) DeletedAtCleared

func (m *NotificationChannelMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*NotificationChannelMutation) Disabled

func (m *NotificationChannelMutation) Disabled() (r bool, exists bool)

Disabled returns the value of the "disabled" field in the mutation.

func (*NotificationChannelMutation) DisabledCleared

func (m *NotificationChannelMutation) DisabledCleared() bool

DisabledCleared returns if the "disabled" field was cleared in this mutation.

func (*NotificationChannelMutation) EdgeCleared

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

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

func (*NotificationChannelMutation) Field

func (m *NotificationChannelMutation) 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 (*NotificationChannelMutation) FieldCleared

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

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

func (*NotificationChannelMutation) Fields

func (m *NotificationChannelMutation) 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 (*NotificationChannelMutation) GetType

func (m *NotificationChannelMutation) GetType() (r notification.ChannelType, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*NotificationChannelMutation) ID

func (m *NotificationChannelMutation) ID() (id string, 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 (*NotificationChannelMutation) IDs

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 (*NotificationChannelMutation) Name

func (m *NotificationChannelMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*NotificationChannelMutation) Namespace

func (m *NotificationChannelMutation) Namespace() (r string, exists bool)

Namespace returns the value of the "namespace" field in the mutation.

func (*NotificationChannelMutation) OldConfig

OldConfig returns the old "config" field's value of the NotificationChannel entity. If the NotificationChannel 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 (*NotificationChannelMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the NotificationChannel entity. If the NotificationChannel 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 (*NotificationChannelMutation) OldDeletedAt

func (m *NotificationChannelMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the NotificationChannel entity. If the NotificationChannel 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 (*NotificationChannelMutation) OldDisabled

func (m *NotificationChannelMutation) OldDisabled(ctx context.Context) (v bool, err error)

OldDisabled returns the old "disabled" field's value of the NotificationChannel entity. If the NotificationChannel 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 (*NotificationChannelMutation) OldField

func (m *NotificationChannelMutation) 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 (*NotificationChannelMutation) OldName

func (m *NotificationChannelMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the NotificationChannel entity. If the NotificationChannel 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 (*NotificationChannelMutation) OldNamespace

func (m *NotificationChannelMutation) OldNamespace(ctx context.Context) (v string, err error)

OldNamespace returns the old "namespace" field's value of the NotificationChannel entity. If the NotificationChannel 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 (*NotificationChannelMutation) OldType

OldType returns the old "type" field's value of the NotificationChannel entity. If the NotificationChannel 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 (*NotificationChannelMutation) OldUpdatedAt

func (m *NotificationChannelMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the NotificationChannel entity. If the NotificationChannel 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 (*NotificationChannelMutation) Op

Op returns the operation name.

func (*NotificationChannelMutation) RemoveRuleIDs

func (m *NotificationChannelMutation) RemoveRuleIDs(ids ...string)

RemoveRuleIDs removes the "rules" edge to the NotificationRule entity by IDs.

func (*NotificationChannelMutation) RemovedEdges

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

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

func (*NotificationChannelMutation) RemovedIDs

func (m *NotificationChannelMutation) 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 (*NotificationChannelMutation) RemovedRulesIDs

func (m *NotificationChannelMutation) RemovedRulesIDs() (ids []string)

RemovedRules returns the removed IDs of the "rules" edge to the NotificationRule entity.

func (*NotificationChannelMutation) ResetConfig

func (m *NotificationChannelMutation) ResetConfig()

ResetConfig resets all changes to the "config" field.

func (*NotificationChannelMutation) ResetCreatedAt

func (m *NotificationChannelMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*NotificationChannelMutation) ResetDeletedAt

func (m *NotificationChannelMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*NotificationChannelMutation) ResetDisabled

func (m *NotificationChannelMutation) ResetDisabled()

ResetDisabled resets all changes to the "disabled" field.

func (*NotificationChannelMutation) ResetEdge

func (m *NotificationChannelMutation) 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 (*NotificationChannelMutation) ResetField

func (m *NotificationChannelMutation) 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 (*NotificationChannelMutation) ResetName

func (m *NotificationChannelMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*NotificationChannelMutation) ResetNamespace

func (m *NotificationChannelMutation) ResetNamespace()

ResetNamespace resets all changes to the "namespace" field.

func (*NotificationChannelMutation) ResetRules

func (m *NotificationChannelMutation) ResetRules()

ResetRules resets all changes to the "rules" edge.

func (*NotificationChannelMutation) ResetType

func (m *NotificationChannelMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*NotificationChannelMutation) ResetUpdatedAt

func (m *NotificationChannelMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*NotificationChannelMutation) RulesCleared

func (m *NotificationChannelMutation) RulesCleared() bool

RulesCleared reports if the "rules" edge to the NotificationRule entity was cleared.

func (*NotificationChannelMutation) RulesIDs

func (m *NotificationChannelMutation) RulesIDs() (ids []string)

RulesIDs returns the "rules" edge IDs in the mutation.

func (*NotificationChannelMutation) SetConfig

SetConfig sets the "config" field.

func (*NotificationChannelMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*NotificationChannelMutation) SetDeletedAt

func (m *NotificationChannelMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*NotificationChannelMutation) SetDisabled

func (m *NotificationChannelMutation) SetDisabled(b bool)

SetDisabled sets the "disabled" field.

func (*NotificationChannelMutation) SetField

func (m *NotificationChannelMutation) 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 (*NotificationChannelMutation) SetID

func (m *NotificationChannelMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of NotificationChannel entities.

func (*NotificationChannelMutation) SetName

func (m *NotificationChannelMutation) SetName(s string)

SetName sets the "name" field.

func (*NotificationChannelMutation) SetNamespace

func (m *NotificationChannelMutation) SetNamespace(s string)

SetNamespace sets the "namespace" field.

func (*NotificationChannelMutation) SetOp

func (m *NotificationChannelMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*NotificationChannelMutation) SetType

SetType sets the "type" field.

func (*NotificationChannelMutation) SetUpdatedAt

func (m *NotificationChannelMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (NotificationChannelMutation) Tx

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

func (*NotificationChannelMutation) Type

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

func (*NotificationChannelMutation) UpdatedAt

func (m *NotificationChannelMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*NotificationChannelMutation) Where

Where appends a list predicates to the NotificationChannelMutation builder.

func (*NotificationChannelMutation) WhereP

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

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

type NotificationChannelQuery

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

NotificationChannelQuery is the builder for querying NotificationChannel entities.

func (*NotificationChannelQuery) Aggregate

Aggregate returns a NotificationChannelSelect configured with the given aggregations.

func (*NotificationChannelQuery) All

All executes the query and returns a list of NotificationChannels.

func (*NotificationChannelQuery) AllX

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

func (*NotificationChannelQuery) Clone

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

func (*NotificationChannelQuery) Count

func (ncq *NotificationChannelQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NotificationChannelQuery) CountX

func (ncq *NotificationChannelQuery) CountX(ctx context.Context) int

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

func (*NotificationChannelQuery) Exist

func (ncq *NotificationChannelQuery) Exist(ctx context.Context) (bool, error)

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

func (*NotificationChannelQuery) ExistX

func (ncq *NotificationChannelQuery) ExistX(ctx context.Context) bool

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

func (*NotificationChannelQuery) First

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

func (*NotificationChannelQuery) FirstID

func (ncq *NotificationChannelQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*NotificationChannelQuery) FirstIDX

func (ncq *NotificationChannelQuery) FirstIDX(ctx context.Context) string

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

func (*NotificationChannelQuery) FirstX

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

func (*NotificationChannelQuery) ForShare

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*NotificationChannelQuery) ForUpdate

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*NotificationChannelQuery) GroupBy

func (ncq *NotificationChannelQuery) GroupBy(field string, fields ...string) *NotificationChannelGroupBy

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 {
	Namespace string `json:"namespace,omitempty"`
	Count int `json:"count,omitempty"`
}

client.NotificationChannel.Query().
	GroupBy(notificationchannel.FieldNamespace).
	Aggregate(db.Count()).
	Scan(ctx, &v)

func (*NotificationChannelQuery) IDs

func (ncq *NotificationChannelQuery) IDs(ctx context.Context) (ids []string, err error)

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

func (*NotificationChannelQuery) IDsX

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

func (*NotificationChannelQuery) Limit

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

func (*NotificationChannelQuery) Offset

Offset to start from.

func (*NotificationChannelQuery) Only

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

func (*NotificationChannelQuery) OnlyID

func (ncq *NotificationChannelQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*NotificationChannelQuery) OnlyIDX

func (ncq *NotificationChannelQuery) OnlyIDX(ctx context.Context) string

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

func (*NotificationChannelQuery) OnlyX

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

func (*NotificationChannelQuery) Order

Order specifies how the records should be ordered.

func (*NotificationChannelQuery) Paginate

Paginate runs the query and returns a paginated response. If page is its 0 value then it will return all the items and populate the response page accordingly.

func (*NotificationChannelQuery) QueryRules

QueryRules chains the current query on the "rules" edge.

func (*NotificationChannelQuery) Select

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 {
	Namespace string `json:"namespace,omitempty"`
}

client.NotificationChannel.Query().
	Select(notificationchannel.FieldNamespace).
	Scan(ctx, &v)

func (*NotificationChannelQuery) Unique

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 (*NotificationChannelQuery) Where

Where adds a new predicate for the NotificationChannelQuery builder.

func (*NotificationChannelQuery) WithRules

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

type NotificationChannelSelect

type NotificationChannelSelect struct {
	*NotificationChannelQuery
	// contains filtered or unexported fields
}

NotificationChannelSelect is the builder for selecting fields of NotificationChannel entities.

func (*NotificationChannelSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*NotificationChannelSelect) Bool

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

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

func (*NotificationChannelSelect) BoolX

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

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

func (*NotificationChannelSelect) Bools

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

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

func (*NotificationChannelSelect) BoolsX

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

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

func (*NotificationChannelSelect) Float64

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

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

func (*NotificationChannelSelect) Float64X

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

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

func (*NotificationChannelSelect) Float64s

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

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

func (*NotificationChannelSelect) Float64sX

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

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

func (*NotificationChannelSelect) Int

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

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

func (*NotificationChannelSelect) IntX

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

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

func (*NotificationChannelSelect) Ints

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

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

func (*NotificationChannelSelect) IntsX

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

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

func (*NotificationChannelSelect) Scan

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

func (*NotificationChannelSelect) ScanX

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

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

func (*NotificationChannelSelect) String

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

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

func (*NotificationChannelSelect) StringX

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

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

func (*NotificationChannelSelect) Strings

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

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

func (*NotificationChannelSelect) StringsX

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

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

type NotificationChannelUpdate

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

NotificationChannelUpdate is the builder for updating NotificationChannel entities.

func (*NotificationChannelUpdate) AddRuleIDs

AddRuleIDs adds the "rules" edge to the NotificationRule entity by IDs.

func (*NotificationChannelUpdate) AddRules

AddRules adds the "rules" edges to the NotificationRule entity.

func (*NotificationChannelUpdate) ClearDeletedAt

ClearDeletedAt clears the value of the "deleted_at" field.

func (*NotificationChannelUpdate) ClearDisabled

ClearDisabled clears the value of the "disabled" field.

func (*NotificationChannelUpdate) ClearRules

ClearRules clears all "rules" edges to the NotificationRule entity.

func (*NotificationChannelUpdate) Exec

Exec executes the query.

func (*NotificationChannelUpdate) ExecX

func (ncu *NotificationChannelUpdate) ExecX(ctx context.Context)

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

func (*NotificationChannelUpdate) Mutation

Mutation returns the NotificationChannelMutation object of the builder.

func (*NotificationChannelUpdate) RemoveRuleIDs

func (ncu *NotificationChannelUpdate) RemoveRuleIDs(ids ...string) *NotificationChannelUpdate

RemoveRuleIDs removes the "rules" edge to NotificationRule entities by IDs.

func (*NotificationChannelUpdate) RemoveRules

RemoveRules removes "rules" edges to NotificationRule entities.

func (*NotificationChannelUpdate) Save

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

func (*NotificationChannelUpdate) SaveX

func (ncu *NotificationChannelUpdate) SaveX(ctx context.Context) int

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

func (*NotificationChannelUpdate) SetConfig

SetConfig sets the "config" field.

func (*NotificationChannelUpdate) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*NotificationChannelUpdate) SetDisabled

SetDisabled sets the "disabled" field.

func (*NotificationChannelUpdate) SetName

SetName sets the "name" field.

func (*NotificationChannelUpdate) SetNillableConfig

SetNillableConfig sets the "config" field if the given value is not nil.

func (*NotificationChannelUpdate) SetNillableDeletedAt

func (ncu *NotificationChannelUpdate) SetNillableDeletedAt(t *time.Time) *NotificationChannelUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*NotificationChannelUpdate) SetNillableDisabled

func (ncu *NotificationChannelUpdate) SetNillableDisabled(b *bool) *NotificationChannelUpdate

SetNillableDisabled sets the "disabled" field if the given value is not nil.

func (*NotificationChannelUpdate) SetNillableName

SetNillableName sets the "name" field if the given value is not nil.

func (*NotificationChannelUpdate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*NotificationChannelUpdate) Where

Where appends a list predicates to the NotificationChannelUpdate builder.

type NotificationChannelUpdateOne

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

NotificationChannelUpdateOne is the builder for updating a single NotificationChannel entity.

func (*NotificationChannelUpdateOne) AddRuleIDs

AddRuleIDs adds the "rules" edge to the NotificationRule entity by IDs.

func (*NotificationChannelUpdateOne) AddRules

AddRules adds the "rules" edges to the NotificationRule entity.

func (*NotificationChannelUpdateOne) ClearDeletedAt

ClearDeletedAt clears the value of the "deleted_at" field.

func (*NotificationChannelUpdateOne) ClearDisabled

ClearDisabled clears the value of the "disabled" field.

func (*NotificationChannelUpdateOne) ClearRules

ClearRules clears all "rules" edges to the NotificationRule entity.

func (*NotificationChannelUpdateOne) Exec

Exec executes the query on the entity.

func (*NotificationChannelUpdateOne) ExecX

func (ncuo *NotificationChannelUpdateOne) ExecX(ctx context.Context)

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

func (*NotificationChannelUpdateOne) Mutation

Mutation returns the NotificationChannelMutation object of the builder.

func (*NotificationChannelUpdateOne) RemoveRuleIDs

RemoveRuleIDs removes the "rules" edge to NotificationRule entities by IDs.

func (*NotificationChannelUpdateOne) RemoveRules

RemoveRules removes "rules" edges to NotificationRule entities.

func (*NotificationChannelUpdateOne) Save

Save executes the query and returns the updated NotificationChannel entity.

func (*NotificationChannelUpdateOne) SaveX

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

func (*NotificationChannelUpdateOne) Select

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

func (*NotificationChannelUpdateOne) SetConfig

SetConfig sets the "config" field.

func (*NotificationChannelUpdateOne) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*NotificationChannelUpdateOne) SetDisabled

SetDisabled sets the "disabled" field.

func (*NotificationChannelUpdateOne) SetName

SetName sets the "name" field.

func (*NotificationChannelUpdateOne) SetNillableConfig

SetNillableConfig sets the "config" field if the given value is not nil.

func (*NotificationChannelUpdateOne) SetNillableDeletedAt

func (ncuo *NotificationChannelUpdateOne) SetNillableDeletedAt(t *time.Time) *NotificationChannelUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*NotificationChannelUpdateOne) SetNillableDisabled

func (ncuo *NotificationChannelUpdateOne) SetNillableDisabled(b *bool) *NotificationChannelUpdateOne

SetNillableDisabled sets the "disabled" field if the given value is not nil.

func (*NotificationChannelUpdateOne) SetNillableName

SetNillableName sets the "name" field if the given value is not nil.

func (*NotificationChannelUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*NotificationChannelUpdateOne) Where

Where appends a list predicates to the NotificationChannelUpdate builder.

type NotificationChannelUpsert

type NotificationChannelUpsert struct {
	*sql.UpdateSet
}

NotificationChannelUpsert is the "OnConflict" setter.

func (*NotificationChannelUpsert) ClearDeletedAt

ClearDeletedAt clears the value of the "deleted_at" field.

func (*NotificationChannelUpsert) ClearDisabled

ClearDisabled clears the value of the "disabled" field.

func (*NotificationChannelUpsert) SetConfig

SetConfig sets the "config" field.

func (*NotificationChannelUpsert) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*NotificationChannelUpsert) SetDisabled

SetDisabled sets the "disabled" field.

func (*NotificationChannelUpsert) SetName

SetName sets the "name" field.

func (*NotificationChannelUpsert) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*NotificationChannelUpsert) UpdateConfig

UpdateConfig sets the "config" field to the value that was provided on create.

func (*NotificationChannelUpsert) UpdateDeletedAt

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*NotificationChannelUpsert) UpdateDisabled

UpdateDisabled sets the "disabled" field to the value that was provided on create.

func (*NotificationChannelUpsert) UpdateName

UpdateName sets the "name" field to the value that was provided on create.

func (*NotificationChannelUpsert) UpdateUpdatedAt

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type NotificationChannelUpsertBulk

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

NotificationChannelUpsertBulk is the builder for "upsert"-ing a bulk of NotificationChannel nodes.

func (*NotificationChannelUpsertBulk) ClearDeletedAt

ClearDeletedAt clears the value of the "deleted_at" field.

func (*NotificationChannelUpsertBulk) ClearDisabled

ClearDisabled clears the value of the "disabled" field.

func (*NotificationChannelUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*NotificationChannelUpsertBulk) Exec

Exec executes the query.

func (*NotificationChannelUpsertBulk) ExecX

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

func (*NotificationChannelUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.NotificationChannel.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*NotificationChannelUpsertBulk) SetConfig

SetConfig sets the "config" field.

func (*NotificationChannelUpsertBulk) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*NotificationChannelUpsertBulk) SetDisabled

SetDisabled sets the "disabled" field.

func (*NotificationChannelUpsertBulk) SetName

SetName sets the "name" field.

func (*NotificationChannelUpsertBulk) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*NotificationChannelUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the NotificationChannelCreateBulk.OnConflict documentation for more info.

func (*NotificationChannelUpsertBulk) UpdateConfig

UpdateConfig sets the "config" field to the value that was provided on create.

func (*NotificationChannelUpsertBulk) UpdateDeletedAt

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*NotificationChannelUpsertBulk) UpdateDisabled

UpdateDisabled sets the "disabled" field to the value that was provided on create.

func (*NotificationChannelUpsertBulk) UpdateName

UpdateName sets the "name" field to the value that was provided on create.

func (*NotificationChannelUpsertBulk) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.NotificationChannel.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(notificationchannel.FieldID)
		}),
	).
	Exec(ctx)

func (*NotificationChannelUpsertBulk) UpdateUpdatedAt

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type NotificationChannelUpsertOne

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

NotificationChannelUpsertOne is the builder for "upsert"-ing

one NotificationChannel node.

func (*NotificationChannelUpsertOne) ClearDeletedAt

ClearDeletedAt clears the value of the "deleted_at" field.

func (*NotificationChannelUpsertOne) ClearDisabled

ClearDisabled clears the value of the "disabled" field.

func (*NotificationChannelUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*NotificationChannelUpsertOne) Exec

Exec executes the query.

func (*NotificationChannelUpsertOne) ExecX

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

func (*NotificationChannelUpsertOne) ID

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*NotificationChannelUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*NotificationChannelUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.NotificationChannel.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*NotificationChannelUpsertOne) SetConfig

SetConfig sets the "config" field.

func (*NotificationChannelUpsertOne) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*NotificationChannelUpsertOne) SetDisabled

SetDisabled sets the "disabled" field.

func (*NotificationChannelUpsertOne) SetName

SetName sets the "name" field.

func (*NotificationChannelUpsertOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*NotificationChannelUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the NotificationChannelCreate.OnConflict documentation for more info.

func (*NotificationChannelUpsertOne) UpdateConfig

UpdateConfig sets the "config" field to the value that was provided on create.

func (*NotificationChannelUpsertOne) UpdateDeletedAt

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*NotificationChannelUpsertOne) UpdateDisabled

UpdateDisabled sets the "disabled" field to the value that was provided on create.

func (*NotificationChannelUpsertOne) UpdateName

UpdateName sets the "name" field to the value that was provided on create.

func (*NotificationChannelUpsertOne) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.NotificationChannel.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(notificationchannel.FieldID)
		}),
	).
	Exec(ctx)

func (*NotificationChannelUpsertOne) UpdateUpdatedAt

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type NotificationChannels

type NotificationChannels []*NotificationChannel

NotificationChannels is a parsable slice of NotificationChannel.

type NotificationEvent

type NotificationEvent struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// Namespace holds the value of the "namespace" field.
	Namespace string `json:"namespace,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// The event type the rule associated with
	Type notification.EventType `json:"type,omitempty"`
	// RuleID holds the value of the "rule_id" field.
	RuleID string `json:"rule_id,omitempty"`
	// Payload holds the value of the "payload" field.
	Payload string `json:"payload,omitempty"`
	// Annotations holds the value of the "annotations" field.
	Annotations map[string]interface{} `json:"annotations,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the NotificationEventQuery when eager-loading is set.
	Edges NotificationEventEdges `json:"edges"`
	// contains filtered or unexported fields
}

NotificationEvent is the model entity for the NotificationEvent schema.

func (*NotificationEvent) QueryDeliveryStatuses

func (ne *NotificationEvent) QueryDeliveryStatuses() *NotificationEventDeliveryStatusQuery

QueryDeliveryStatuses queries the "delivery_statuses" edge of the NotificationEvent entity.

func (*NotificationEvent) QueryRules

func (ne *NotificationEvent) QueryRules() *NotificationRuleQuery

QueryRules queries the "rules" edge of the NotificationEvent entity.

func (*NotificationEvent) String

func (ne *NotificationEvent) String() string

String implements the fmt.Stringer.

func (*NotificationEvent) Unwrap

func (ne *NotificationEvent) Unwrap() *NotificationEvent

Unwrap unwraps the NotificationEvent 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 (*NotificationEvent) Update

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

func (*NotificationEvent) Value

func (ne *NotificationEvent) Value(name string) (ent.Value, error)

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

type NotificationEventClient

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

NotificationEventClient is a client for the NotificationEvent schema.

func NewNotificationEventClient

func NewNotificationEventClient(c config) *NotificationEventClient

NewNotificationEventClient returns a client for the NotificationEvent from the given config.

func (*NotificationEventClient) Create

Create returns a builder for creating a NotificationEvent entity.

func (*NotificationEventClient) CreateBulk

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

func (*NotificationEventClient) Delete

Delete returns a delete builder for NotificationEvent.

func (*NotificationEventClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*NotificationEventClient) DeleteOneID

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

func (*NotificationEventClient) Get

Get returns a NotificationEvent entity by its id.

func (*NotificationEventClient) GetX

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

func (*NotificationEventClient) Hooks

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

Hooks returns the client hooks.

func (*NotificationEventClient) Intercept

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

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

func (*NotificationEventClient) Interceptors

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

Interceptors returns the client interceptors.

func (*NotificationEventClient) MapCreateBulk

func (c *NotificationEventClient) MapCreateBulk(slice any, setFunc func(*NotificationEventCreate, int)) *NotificationEventCreateBulk

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 (*NotificationEventClient) Query

Query returns a query builder for NotificationEvent.

func (*NotificationEventClient) QueryDeliveryStatuses

QueryDeliveryStatuses queries the delivery_statuses edge of a NotificationEvent.

func (*NotificationEventClient) QueryRules

QueryRules queries the rules edge of a NotificationEvent.

func (*NotificationEventClient) Update

Update returns an update builder for NotificationEvent.

func (*NotificationEventClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*NotificationEventClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*NotificationEventClient) Use

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

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

type NotificationEventCreate

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

NotificationEventCreate is the builder for creating a NotificationEvent entity.

func (*NotificationEventCreate) AddDeliveryStatusIDs

func (nec *NotificationEventCreate) AddDeliveryStatusIDs(ids ...string) *NotificationEventCreate

AddDeliveryStatusIDs adds the "delivery_statuses" edge to the NotificationEventDeliveryStatus entity by IDs.

func (*NotificationEventCreate) AddDeliveryStatuses

AddDeliveryStatuses adds the "delivery_statuses" edges to the NotificationEventDeliveryStatus entity.

func (*NotificationEventCreate) Exec

Exec executes the query.

func (*NotificationEventCreate) ExecX

func (nec *NotificationEventCreate) ExecX(ctx context.Context)

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

func (*NotificationEventCreate) Mutation

Mutation returns the NotificationEventMutation object of the builder.

func (*NotificationEventCreate) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.NotificationEvent.Create().
	SetNamespace(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.NotificationEventUpsert) {
		SetNamespace(v+v).
	}).
	Exec(ctx)

func (*NotificationEventCreate) OnConflictColumns

func (nec *NotificationEventCreate) OnConflictColumns(columns ...string) *NotificationEventUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.NotificationEvent.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*NotificationEventCreate) Save

Save creates the NotificationEvent in the database.

func (*NotificationEventCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*NotificationEventCreate) SetAnnotations

func (nec *NotificationEventCreate) SetAnnotations(m map[string]interface{}) *NotificationEventCreate

SetAnnotations sets the "annotations" field.

func (*NotificationEventCreate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*NotificationEventCreate) SetID

SetID sets the "id" field.

func (*NotificationEventCreate) SetNamespace

SetNamespace sets the "namespace" field.

func (*NotificationEventCreate) SetNillableCreatedAt

func (nec *NotificationEventCreate) SetNillableCreatedAt(t *time.Time) *NotificationEventCreate

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

func (*NotificationEventCreate) SetNillableID

func (nec *NotificationEventCreate) SetNillableID(s *string) *NotificationEventCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*NotificationEventCreate) SetPayload

SetPayload sets the "payload" field.

func (*NotificationEventCreate) SetRuleID

SetRuleID sets the "rule_id" field.

func (*NotificationEventCreate) SetRules

SetRules sets the "rules" edge to the NotificationRule entity.

func (*NotificationEventCreate) SetRulesID

SetRulesID sets the "rules" edge to the NotificationRule entity by ID.

func (*NotificationEventCreate) SetType

SetType sets the "type" field.

type NotificationEventCreateBulk

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

NotificationEventCreateBulk is the builder for creating many NotificationEvent entities in bulk.

func (*NotificationEventCreateBulk) Exec

Exec executes the query.

func (*NotificationEventCreateBulk) ExecX

func (necb *NotificationEventCreateBulk) ExecX(ctx context.Context)

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

func (*NotificationEventCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.NotificationEvent.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.NotificationEventUpsert) {
		SetNamespace(v+v).
	}).
	Exec(ctx)

func (*NotificationEventCreateBulk) OnConflictColumns

func (necb *NotificationEventCreateBulk) OnConflictColumns(columns ...string) *NotificationEventUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.NotificationEvent.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*NotificationEventCreateBulk) Save

Save creates the NotificationEvent entities in the database.

func (*NotificationEventCreateBulk) SaveX

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

type NotificationEventDelete

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

NotificationEventDelete is the builder for deleting a NotificationEvent entity.

func (*NotificationEventDelete) Exec

func (ned *NotificationEventDelete) Exec(ctx context.Context) (int, error)

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

func (*NotificationEventDelete) ExecX

func (ned *NotificationEventDelete) ExecX(ctx context.Context) int

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

func (*NotificationEventDelete) Where

Where appends a list predicates to the NotificationEventDelete builder.

type NotificationEventDeleteOne

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

NotificationEventDeleteOne is the builder for deleting a single NotificationEvent entity.

func (*NotificationEventDeleteOne) Exec

Exec executes the deletion query.

func (*NotificationEventDeleteOne) ExecX

func (nedo *NotificationEventDeleteOne) ExecX(ctx context.Context)

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

func (*NotificationEventDeleteOne) Where

Where appends a list predicates to the NotificationEventDelete builder.

type NotificationEventDeliveryStatus

type NotificationEventDeliveryStatus struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// Namespace holds the value of the "namespace" field.
	Namespace string `json:"namespace,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"`
	// EventID holds the value of the "event_id" field.
	EventID string `json:"event_id,omitempty"`
	// ChannelID holds the value of the "channel_id" field.
	ChannelID string `json:"channel_id,omitempty"`
	// State holds the value of the "state" field.
	State notification.EventDeliveryStatusState `json:"state,omitempty"`
	// Reason holds the value of the "reason" field.
	Reason string `json:"reason,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the NotificationEventDeliveryStatusQuery when eager-loading is set.
	Edges NotificationEventDeliveryStatusEdges `json:"edges"`
	// contains filtered or unexported fields
}

NotificationEventDeliveryStatus is the model entity for the NotificationEventDeliveryStatus schema.

func (*NotificationEventDeliveryStatus) QueryEvents

QueryEvents queries the "events" edge of the NotificationEventDeliveryStatus entity.

func (*NotificationEventDeliveryStatus) String

func (neds *NotificationEventDeliveryStatus) String() string

String implements the fmt.Stringer.

func (*NotificationEventDeliveryStatus) Unwrap

Unwrap unwraps the NotificationEventDeliveryStatus 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 (*NotificationEventDeliveryStatus) Update

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

func (*NotificationEventDeliveryStatus) Value

func (neds *NotificationEventDeliveryStatus) Value(name string) (ent.Value, error)

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

type NotificationEventDeliveryStatusClient

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

NotificationEventDeliveryStatusClient is a client for the NotificationEventDeliveryStatus schema.

func NewNotificationEventDeliveryStatusClient

func NewNotificationEventDeliveryStatusClient(c config) *NotificationEventDeliveryStatusClient

NewNotificationEventDeliveryStatusClient returns a client for the NotificationEventDeliveryStatus from the given config.

func (*NotificationEventDeliveryStatusClient) Create

Create returns a builder for creating a NotificationEventDeliveryStatus entity.

func (*NotificationEventDeliveryStatusClient) CreateBulk

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

func (*NotificationEventDeliveryStatusClient) Delete

Delete returns a delete builder for NotificationEventDeliveryStatus.

func (*NotificationEventDeliveryStatusClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*NotificationEventDeliveryStatusClient) DeleteOneID

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

func (*NotificationEventDeliveryStatusClient) Get

Get returns a NotificationEventDeliveryStatus entity by its id.

func (*NotificationEventDeliveryStatusClient) GetX

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

func (*NotificationEventDeliveryStatusClient) Hooks

Hooks returns the client hooks.

func (*NotificationEventDeliveryStatusClient) Intercept

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

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `notificationeventdeliverystatus.Intercept(f(g(h())))`.

func (*NotificationEventDeliveryStatusClient) Interceptors

Interceptors returns the client interceptors.

func (*NotificationEventDeliveryStatusClient) MapCreateBulk

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 (*NotificationEventDeliveryStatusClient) Query

Query returns a query builder for NotificationEventDeliveryStatus.

func (*NotificationEventDeliveryStatusClient) QueryEvents

QueryEvents queries the events edge of a NotificationEventDeliveryStatus.

func (*NotificationEventDeliveryStatusClient) Update

Update returns an update builder for NotificationEventDeliveryStatus.

func (*NotificationEventDeliveryStatusClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*NotificationEventDeliveryStatusClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*NotificationEventDeliveryStatusClient) Use

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `notificationeventdeliverystatus.Hooks(f(g(h())))`.

type NotificationEventDeliveryStatusCreate

type NotificationEventDeliveryStatusCreate struct {
	// contains filtered or unexported fields
}

NotificationEventDeliveryStatusCreate is the builder for creating a NotificationEventDeliveryStatus entity.

func (*NotificationEventDeliveryStatusCreate) AddEventIDs

AddEventIDs adds the "events" edge to the NotificationEvent entity by IDs.

func (*NotificationEventDeliveryStatusCreate) AddEvents

AddEvents adds the "events" edges to the NotificationEvent entity.

func (*NotificationEventDeliveryStatusCreate) Exec

Exec executes the query.

func (*NotificationEventDeliveryStatusCreate) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*NotificationEventDeliveryStatusCreate) Mutation

Mutation returns the NotificationEventDeliveryStatusMutation object of the builder.

func (*NotificationEventDeliveryStatusCreate) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.NotificationEventDeliveryStatus.Create().
	SetNamespace(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.NotificationEventDeliveryStatusUpsert) {
		SetNamespace(v+v).
	}).
	Exec(ctx)

func (*NotificationEventDeliveryStatusCreate) OnConflictColumns

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.NotificationEventDeliveryStatus.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*NotificationEventDeliveryStatusCreate) Save

Save creates the NotificationEventDeliveryStatus in the database.

func (*NotificationEventDeliveryStatusCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*NotificationEventDeliveryStatusCreate) SetChannelID

SetChannelID sets the "channel_id" field.

func (*NotificationEventDeliveryStatusCreate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*NotificationEventDeliveryStatusCreate) SetEventID

SetEventID sets the "event_id" field.

func (*NotificationEventDeliveryStatusCreate) SetID

SetID sets the "id" field.

func (*NotificationEventDeliveryStatusCreate) SetNamespace

SetNamespace sets the "namespace" field.

func (*NotificationEventDeliveryStatusCreate) SetNillableCreatedAt

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*NotificationEventDeliveryStatusCreate) SetNillableID

SetNillableID sets the "id" field if the given value is not nil.

func (*NotificationEventDeliveryStatusCreate) SetNillableReason

SetNillableReason sets the "reason" field if the given value is not nil.

func (*NotificationEventDeliveryStatusCreate) SetNillableState

SetNillableState sets the "state" field if the given value is not nil.

func (*NotificationEventDeliveryStatusCreate) SetNillableUpdatedAt

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*NotificationEventDeliveryStatusCreate) SetReason

SetReason sets the "reason" field.

func (*NotificationEventDeliveryStatusCreate) SetState

SetState sets the "state" field.

func (*NotificationEventDeliveryStatusCreate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

type NotificationEventDeliveryStatusCreateBulk

type NotificationEventDeliveryStatusCreateBulk struct {
	// contains filtered or unexported fields
}

NotificationEventDeliveryStatusCreateBulk is the builder for creating many NotificationEventDeliveryStatus entities in bulk.

func (*NotificationEventDeliveryStatusCreateBulk) Exec

Exec executes the query.

func (*NotificationEventDeliveryStatusCreateBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*NotificationEventDeliveryStatusCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.NotificationEventDeliveryStatus.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.NotificationEventDeliveryStatusUpsert) {
		SetNamespace(v+v).
	}).
	Exec(ctx)

func (*NotificationEventDeliveryStatusCreateBulk) OnConflictColumns

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.NotificationEventDeliveryStatus.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*NotificationEventDeliveryStatusCreateBulk) Save

Save creates the NotificationEventDeliveryStatus entities in the database.

func (*NotificationEventDeliveryStatusCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type NotificationEventDeliveryStatusDelete

type NotificationEventDeliveryStatusDelete struct {
	// contains filtered or unexported fields
}

NotificationEventDeliveryStatusDelete is the builder for deleting a NotificationEventDeliveryStatus entity.

func (*NotificationEventDeliveryStatusDelete) Exec

Exec executes the deletion query and returns how many vertices were deleted.

func (*NotificationEventDeliveryStatusDelete) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*NotificationEventDeliveryStatusDelete) Where

Where appends a list predicates to the NotificationEventDeliveryStatusDelete builder.

type NotificationEventDeliveryStatusDeleteOne

type NotificationEventDeliveryStatusDeleteOne struct {
	// contains filtered or unexported fields
}

NotificationEventDeliveryStatusDeleteOne is the builder for deleting a single NotificationEventDeliveryStatus entity.

func (*NotificationEventDeliveryStatusDeleteOne) Exec

Exec executes the deletion query.

func (*NotificationEventDeliveryStatusDeleteOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*NotificationEventDeliveryStatusDeleteOne) Where

Where appends a list predicates to the NotificationEventDeliveryStatusDelete builder.

type NotificationEventDeliveryStatusEdges

type NotificationEventDeliveryStatusEdges struct {
	// Events holds the value of the events edge.
	Events []*NotificationEvent `json:"events,omitempty"`
	// contains filtered or unexported fields
}

NotificationEventDeliveryStatusEdges holds the relations/edges for other nodes in the graph.

func (NotificationEventDeliveryStatusEdges) EventsOrErr

EventsOrErr returns the Events value or an error if the edge was not loaded in eager-loading.

type NotificationEventDeliveryStatusGroupBy

type NotificationEventDeliveryStatusGroupBy struct {
	// contains filtered or unexported fields
}

NotificationEventDeliveryStatusGroupBy is the group-by builder for NotificationEventDeliveryStatus entities.

func (*NotificationEventDeliveryStatusGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*NotificationEventDeliveryStatusGroupBy) Bool

func (s *NotificationEventDeliveryStatusGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NotificationEventDeliveryStatusGroupBy) BoolX

func (s *NotificationEventDeliveryStatusGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NotificationEventDeliveryStatusGroupBy) Bools

func (s *NotificationEventDeliveryStatusGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NotificationEventDeliveryStatusGroupBy) BoolsX

func (s *NotificationEventDeliveryStatusGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NotificationEventDeliveryStatusGroupBy) Float64

func (s *NotificationEventDeliveryStatusGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NotificationEventDeliveryStatusGroupBy) Float64X

func (s *NotificationEventDeliveryStatusGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NotificationEventDeliveryStatusGroupBy) Float64s

func (s *NotificationEventDeliveryStatusGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NotificationEventDeliveryStatusGroupBy) Float64sX

func (s *NotificationEventDeliveryStatusGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NotificationEventDeliveryStatusGroupBy) Int

func (s *NotificationEventDeliveryStatusGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NotificationEventDeliveryStatusGroupBy) IntX

func (s *NotificationEventDeliveryStatusGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NotificationEventDeliveryStatusGroupBy) Ints

func (s *NotificationEventDeliveryStatusGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NotificationEventDeliveryStatusGroupBy) IntsX

func (s *NotificationEventDeliveryStatusGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NotificationEventDeliveryStatusGroupBy) Scan

Scan applies the selector query and scans the result into the given value.

func (*NotificationEventDeliveryStatusGroupBy) ScanX

func (s *NotificationEventDeliveryStatusGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*NotificationEventDeliveryStatusGroupBy) String

func (s *NotificationEventDeliveryStatusGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NotificationEventDeliveryStatusGroupBy) StringX

func (s *NotificationEventDeliveryStatusGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NotificationEventDeliveryStatusGroupBy) Strings

func (s *NotificationEventDeliveryStatusGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NotificationEventDeliveryStatusGroupBy) StringsX

func (s *NotificationEventDeliveryStatusGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NotificationEventDeliveryStatusMutation

type NotificationEventDeliveryStatusMutation struct {
	// contains filtered or unexported fields
}

NotificationEventDeliveryStatusMutation represents an operation that mutates the NotificationEventDeliveryStatus nodes in the graph.

func (*NotificationEventDeliveryStatusMutation) AddEventIDs

func (m *NotificationEventDeliveryStatusMutation) AddEventIDs(ids ...string)

AddEventIDs adds the "events" edge to the NotificationEvent entity by ids.

func (*NotificationEventDeliveryStatusMutation) AddField

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 (*NotificationEventDeliveryStatusMutation) AddedEdges

AddedEdges returns all edge names that were set/added in this mutation.

func (*NotificationEventDeliveryStatusMutation) AddedField

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 (*NotificationEventDeliveryStatusMutation) AddedFields

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*NotificationEventDeliveryStatusMutation) AddedIDs

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*NotificationEventDeliveryStatusMutation) ChannelID

func (m *NotificationEventDeliveryStatusMutation) ChannelID() (r string, exists bool)

ChannelID returns the value of the "channel_id" field in the mutation.

func (*NotificationEventDeliveryStatusMutation) ClearEdge

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 (*NotificationEventDeliveryStatusMutation) ClearEvents

func (m *NotificationEventDeliveryStatusMutation) ClearEvents()

ClearEvents clears the "events" edge to the NotificationEvent entity.

func (*NotificationEventDeliveryStatusMutation) ClearField

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 (*NotificationEventDeliveryStatusMutation) ClearReason

func (m *NotificationEventDeliveryStatusMutation) ClearReason()

ClearReason clears the value of the "reason" field.

func (*NotificationEventDeliveryStatusMutation) ClearedEdges

func (m *NotificationEventDeliveryStatusMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*NotificationEventDeliveryStatusMutation) ClearedFields

func (m *NotificationEventDeliveryStatusMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (NotificationEventDeliveryStatusMutation) 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 (*NotificationEventDeliveryStatusMutation) CreatedAt

func (m *NotificationEventDeliveryStatusMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*NotificationEventDeliveryStatusMutation) EdgeCleared

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*NotificationEventDeliveryStatusMutation) EventID

func (m *NotificationEventDeliveryStatusMutation) EventID() (r string, exists bool)

EventID returns the value of the "event_id" field in the mutation.

func (*NotificationEventDeliveryStatusMutation) EventsCleared

func (m *NotificationEventDeliveryStatusMutation) EventsCleared() bool

EventsCleared reports if the "events" edge to the NotificationEvent entity was cleared.

func (*NotificationEventDeliveryStatusMutation) EventsIDs

func (m *NotificationEventDeliveryStatusMutation) EventsIDs() (ids []string)

EventsIDs returns the "events" edge IDs in the mutation.

func (*NotificationEventDeliveryStatusMutation) Field

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 (*NotificationEventDeliveryStatusMutation) FieldCleared

func (m *NotificationEventDeliveryStatusMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*NotificationEventDeliveryStatusMutation) Fields

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 (*NotificationEventDeliveryStatusMutation) ID

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 (*NotificationEventDeliveryStatusMutation) IDs

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 (*NotificationEventDeliveryStatusMutation) Namespace

func (m *NotificationEventDeliveryStatusMutation) Namespace() (r string, exists bool)

Namespace returns the value of the "namespace" field in the mutation.

func (*NotificationEventDeliveryStatusMutation) OldChannelID

func (m *NotificationEventDeliveryStatusMutation) OldChannelID(ctx context.Context) (v string, err error)

OldChannelID returns the old "channel_id" field's value of the NotificationEventDeliveryStatus entity. If the NotificationEventDeliveryStatus 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 (*NotificationEventDeliveryStatusMutation) OldCreatedAt

func (m *NotificationEventDeliveryStatusMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the NotificationEventDeliveryStatus entity. If the NotificationEventDeliveryStatus 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 (*NotificationEventDeliveryStatusMutation) OldEventID

OldEventID returns the old "event_id" field's value of the NotificationEventDeliveryStatus entity. If the NotificationEventDeliveryStatus 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 (*NotificationEventDeliveryStatusMutation) OldField

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 (*NotificationEventDeliveryStatusMutation) OldNamespace

func (m *NotificationEventDeliveryStatusMutation) OldNamespace(ctx context.Context) (v string, err error)

OldNamespace returns the old "namespace" field's value of the NotificationEventDeliveryStatus entity. If the NotificationEventDeliveryStatus 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 (*NotificationEventDeliveryStatusMutation) OldReason

OldReason returns the old "reason" field's value of the NotificationEventDeliveryStatus entity. If the NotificationEventDeliveryStatus 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 (*NotificationEventDeliveryStatusMutation) OldState

OldState returns the old "state" field's value of the NotificationEventDeliveryStatus entity. If the NotificationEventDeliveryStatus 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 (*NotificationEventDeliveryStatusMutation) OldUpdatedAt

func (m *NotificationEventDeliveryStatusMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the NotificationEventDeliveryStatus entity. If the NotificationEventDeliveryStatus 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 (*NotificationEventDeliveryStatusMutation) Op

Op returns the operation name.

func (*NotificationEventDeliveryStatusMutation) Reason

func (m *NotificationEventDeliveryStatusMutation) Reason() (r string, exists bool)

Reason returns the value of the "reason" field in the mutation.

func (*NotificationEventDeliveryStatusMutation) ReasonCleared

func (m *NotificationEventDeliveryStatusMutation) ReasonCleared() bool

ReasonCleared returns if the "reason" field was cleared in this mutation.

func (*NotificationEventDeliveryStatusMutation) RemoveEventIDs

func (m *NotificationEventDeliveryStatusMutation) RemoveEventIDs(ids ...string)

RemoveEventIDs removes the "events" edge to the NotificationEvent entity by IDs.

func (*NotificationEventDeliveryStatusMutation) RemovedEdges

func (m *NotificationEventDeliveryStatusMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*NotificationEventDeliveryStatusMutation) RemovedEventsIDs

func (m *NotificationEventDeliveryStatusMutation) RemovedEventsIDs() (ids []string)

RemovedEvents returns the removed IDs of the "events" edge to the NotificationEvent entity.

func (*NotificationEventDeliveryStatusMutation) RemovedIDs

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*NotificationEventDeliveryStatusMutation) ResetChannelID

func (m *NotificationEventDeliveryStatusMutation) ResetChannelID()

ResetChannelID resets all changes to the "channel_id" field.

func (*NotificationEventDeliveryStatusMutation) ResetCreatedAt

func (m *NotificationEventDeliveryStatusMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*NotificationEventDeliveryStatusMutation) ResetEdge

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 (*NotificationEventDeliveryStatusMutation) ResetEventID

func (m *NotificationEventDeliveryStatusMutation) ResetEventID()

ResetEventID resets all changes to the "event_id" field.

func (*NotificationEventDeliveryStatusMutation) ResetEvents

func (m *NotificationEventDeliveryStatusMutation) ResetEvents()

ResetEvents resets all changes to the "events" edge.

func (*NotificationEventDeliveryStatusMutation) ResetField

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 (*NotificationEventDeliveryStatusMutation) ResetNamespace

func (m *NotificationEventDeliveryStatusMutation) ResetNamespace()

ResetNamespace resets all changes to the "namespace" field.

func (*NotificationEventDeliveryStatusMutation) ResetReason

func (m *NotificationEventDeliveryStatusMutation) ResetReason()

ResetReason resets all changes to the "reason" field.

func (*NotificationEventDeliveryStatusMutation) ResetState

ResetState resets all changes to the "state" field.

func (*NotificationEventDeliveryStatusMutation) ResetUpdatedAt

func (m *NotificationEventDeliveryStatusMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*NotificationEventDeliveryStatusMutation) SetChannelID

SetChannelID sets the "channel_id" field.

func (*NotificationEventDeliveryStatusMutation) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*NotificationEventDeliveryStatusMutation) SetEventID

SetEventID sets the "event_id" field.

func (*NotificationEventDeliveryStatusMutation) SetField

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 (*NotificationEventDeliveryStatusMutation) SetID

SetID sets the value of the id field. Note that this operation is only accepted on creation of NotificationEventDeliveryStatus entities.

func (*NotificationEventDeliveryStatusMutation) SetNamespace

SetNamespace sets the "namespace" field.

func (*NotificationEventDeliveryStatusMutation) SetOp

SetOp allows setting the mutation operation.

func (*NotificationEventDeliveryStatusMutation) SetReason

SetReason sets the "reason" field.

func (*NotificationEventDeliveryStatusMutation) SetState

SetState sets the "state" field.

func (*NotificationEventDeliveryStatusMutation) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*NotificationEventDeliveryStatusMutation) State

State returns the value of the "state" field in the mutation.

func (NotificationEventDeliveryStatusMutation) Tx

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*NotificationEventDeliveryStatusMutation) Type

Type returns the node type of this mutation (NotificationEventDeliveryStatus).

func (*NotificationEventDeliveryStatusMutation) UpdatedAt

func (m *NotificationEventDeliveryStatusMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*NotificationEventDeliveryStatusMutation) Where

Where appends a list predicates to the NotificationEventDeliveryStatusMutation builder.

func (*NotificationEventDeliveryStatusMutation) WhereP

func (m *NotificationEventDeliveryStatusMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the NotificationEventDeliveryStatusMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type NotificationEventDeliveryStatusQuery

type NotificationEventDeliveryStatusQuery struct {
	// contains filtered or unexported fields
}

NotificationEventDeliveryStatusQuery is the builder for querying NotificationEventDeliveryStatus entities.

func (*NotificationEventDeliveryStatusQuery) Aggregate

Aggregate returns a NotificationEventDeliveryStatusSelect configured with the given aggregations.

func (*NotificationEventDeliveryStatusQuery) All

All executes the query and returns a list of NotificationEventDeliveryStatusSlice.

func (*NotificationEventDeliveryStatusQuery) AllX

AllX is like All, but panics if an error occurs.

func (*NotificationEventDeliveryStatusQuery) Clone

Clone returns a duplicate of the NotificationEventDeliveryStatusQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*NotificationEventDeliveryStatusQuery) Count

Count returns the count of the given query.

func (*NotificationEventDeliveryStatusQuery) CountX

CountX is like Count, but panics if an error occurs.

func (*NotificationEventDeliveryStatusQuery) Exist

Exist returns true if the query has elements in the graph.

func (*NotificationEventDeliveryStatusQuery) ExistX

ExistX is like Exist, but panics if an error occurs.

func (*NotificationEventDeliveryStatusQuery) First

First returns the first NotificationEventDeliveryStatus entity from the query. Returns a *NotFoundError when no NotificationEventDeliveryStatus was found.

func (*NotificationEventDeliveryStatusQuery) FirstID

func (nedsq *NotificationEventDeliveryStatusQuery) FirstID(ctx context.Context) (id string, err error)

FirstID returns the first NotificationEventDeliveryStatus ID from the query. Returns a *NotFoundError when no NotificationEventDeliveryStatus ID was found.

func (*NotificationEventDeliveryStatusQuery) FirstIDX

FirstIDX is like FirstID, but panics if an error occurs.

func (*NotificationEventDeliveryStatusQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*NotificationEventDeliveryStatusQuery) ForShare

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*NotificationEventDeliveryStatusQuery) ForUpdate

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*NotificationEventDeliveryStatusQuery) GroupBy

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 {
	Namespace string `json:"namespace,omitempty"`
	Count int `json:"count,omitempty"`
}

client.NotificationEventDeliveryStatus.Query().
	GroupBy(notificationeventdeliverystatus.FieldNamespace).
	Aggregate(db.Count()).
	Scan(ctx, &v)

func (*NotificationEventDeliveryStatusQuery) IDs

func (nedsq *NotificationEventDeliveryStatusQuery) IDs(ctx context.Context) (ids []string, err error)

IDs executes the query and returns a list of NotificationEventDeliveryStatus IDs.

func (*NotificationEventDeliveryStatusQuery) IDsX

IDsX is like IDs, but panics if an error occurs.

func (*NotificationEventDeliveryStatusQuery) Limit

Limit the number of records to be returned by this query.

func (*NotificationEventDeliveryStatusQuery) Offset

Offset to start from.

func (*NotificationEventDeliveryStatusQuery) Only

Only returns a single NotificationEventDeliveryStatus entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one NotificationEventDeliveryStatus entity is found. Returns a *NotFoundError when no NotificationEventDeliveryStatus entities are found.

func (*NotificationEventDeliveryStatusQuery) OnlyID

func (nedsq *NotificationEventDeliveryStatusQuery) OnlyID(ctx context.Context) (id string, err error)

OnlyID is like Only, but returns the only NotificationEventDeliveryStatus ID in the query. Returns a *NotSingularError when more than one NotificationEventDeliveryStatus ID is found. Returns a *NotFoundError when no entities are found.

func (*NotificationEventDeliveryStatusQuery) OnlyIDX

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*NotificationEventDeliveryStatusQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*NotificationEventDeliveryStatusQuery) Order

Order specifies how the records should be ordered.

func (*NotificationEventDeliveryStatusQuery) Paginate

Paginate runs the query and returns a paginated response. If page is its 0 value then it will return all the items and populate the response page accordingly.

func (*NotificationEventDeliveryStatusQuery) QueryEvents

QueryEvents chains the current query on the "events" edge.

func (*NotificationEventDeliveryStatusQuery) Select

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 {
	Namespace string `json:"namespace,omitempty"`
}

client.NotificationEventDeliveryStatus.Query().
	Select(notificationeventdeliverystatus.FieldNamespace).
	Scan(ctx, &v)

func (*NotificationEventDeliveryStatusQuery) Unique

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 (*NotificationEventDeliveryStatusQuery) Where

Where adds a new predicate for the NotificationEventDeliveryStatusQuery builder.

func (*NotificationEventDeliveryStatusQuery) WithEvents

WithEvents tells the query-builder to eager-load the nodes that are connected to the "events" edge. The optional arguments are used to configure the query builder of the edge.

type NotificationEventDeliveryStatusSelect

type NotificationEventDeliveryStatusSelect struct {
	*NotificationEventDeliveryStatusQuery
	// contains filtered or unexported fields
}

NotificationEventDeliveryStatusSelect is the builder for selecting fields of NotificationEventDeliveryStatus entities.

func (*NotificationEventDeliveryStatusSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*NotificationEventDeliveryStatusSelect) Bool

func (s *NotificationEventDeliveryStatusSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NotificationEventDeliveryStatusSelect) BoolX

func (s *NotificationEventDeliveryStatusSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NotificationEventDeliveryStatusSelect) Bools

func (s *NotificationEventDeliveryStatusSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NotificationEventDeliveryStatusSelect) BoolsX

func (s *NotificationEventDeliveryStatusSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NotificationEventDeliveryStatusSelect) Float64

func (s *NotificationEventDeliveryStatusSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NotificationEventDeliveryStatusSelect) Float64X

func (s *NotificationEventDeliveryStatusSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NotificationEventDeliveryStatusSelect) Float64s

func (s *NotificationEventDeliveryStatusSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NotificationEventDeliveryStatusSelect) Float64sX

func (s *NotificationEventDeliveryStatusSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NotificationEventDeliveryStatusSelect) Int

func (s *NotificationEventDeliveryStatusSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NotificationEventDeliveryStatusSelect) IntX

func (s *NotificationEventDeliveryStatusSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NotificationEventDeliveryStatusSelect) Ints

func (s *NotificationEventDeliveryStatusSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NotificationEventDeliveryStatusSelect) IntsX

func (s *NotificationEventDeliveryStatusSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NotificationEventDeliveryStatusSelect) Scan

Scan applies the selector query and scans the result into the given value.

func (*NotificationEventDeliveryStatusSelect) ScanX

func (s *NotificationEventDeliveryStatusSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*NotificationEventDeliveryStatusSelect) String

func (s *NotificationEventDeliveryStatusSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NotificationEventDeliveryStatusSelect) StringX

func (s *NotificationEventDeliveryStatusSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NotificationEventDeliveryStatusSelect) Strings

func (s *NotificationEventDeliveryStatusSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NotificationEventDeliveryStatusSelect) StringsX

func (s *NotificationEventDeliveryStatusSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NotificationEventDeliveryStatusSlice

type NotificationEventDeliveryStatusSlice []*NotificationEventDeliveryStatus

NotificationEventDeliveryStatusSlice is a parsable slice of NotificationEventDeliveryStatus.

type NotificationEventDeliveryStatusUpdate

type NotificationEventDeliveryStatusUpdate struct {
	// contains filtered or unexported fields
}

NotificationEventDeliveryStatusUpdate is the builder for updating NotificationEventDeliveryStatus entities.

func (*NotificationEventDeliveryStatusUpdate) AddEventIDs

AddEventIDs adds the "events" edge to the NotificationEvent entity by IDs.

func (*NotificationEventDeliveryStatusUpdate) AddEvents

AddEvents adds the "events" edges to the NotificationEvent entity.

func (*NotificationEventDeliveryStatusUpdate) ClearEvents

ClearEvents clears all "events" edges to the NotificationEvent entity.

func (*NotificationEventDeliveryStatusUpdate) ClearReason

ClearReason clears the value of the "reason" field.

func (*NotificationEventDeliveryStatusUpdate) Exec

Exec executes the query.

func (*NotificationEventDeliveryStatusUpdate) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*NotificationEventDeliveryStatusUpdate) Mutation

Mutation returns the NotificationEventDeliveryStatusMutation object of the builder.

func (*NotificationEventDeliveryStatusUpdate) RemoveEventIDs

RemoveEventIDs removes the "events" edge to NotificationEvent entities by IDs.

func (*NotificationEventDeliveryStatusUpdate) RemoveEvents

RemoveEvents removes "events" edges to NotificationEvent entities.

func (*NotificationEventDeliveryStatusUpdate) Save

Save executes the query and returns the number of nodes affected by the update operation.

func (*NotificationEventDeliveryStatusUpdate) SaveX

SaveX is like Save, but panics if an error occurs.

func (*NotificationEventDeliveryStatusUpdate) SetNillableReason

SetNillableReason sets the "reason" field if the given value is not nil.

func (*NotificationEventDeliveryStatusUpdate) SetNillableState

SetNillableState sets the "state" field if the given value is not nil.

func (*NotificationEventDeliveryStatusUpdate) SetReason

SetReason sets the "reason" field.

func (*NotificationEventDeliveryStatusUpdate) SetState

SetState sets the "state" field.

func (*NotificationEventDeliveryStatusUpdate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*NotificationEventDeliveryStatusUpdate) Where

Where appends a list predicates to the NotificationEventDeliveryStatusUpdate builder.

type NotificationEventDeliveryStatusUpdateOne

type NotificationEventDeliveryStatusUpdateOne struct {
	// contains filtered or unexported fields
}

NotificationEventDeliveryStatusUpdateOne is the builder for updating a single NotificationEventDeliveryStatus entity.

func (*NotificationEventDeliveryStatusUpdateOne) AddEventIDs

AddEventIDs adds the "events" edge to the NotificationEvent entity by IDs.

func (*NotificationEventDeliveryStatusUpdateOne) AddEvents

AddEvents adds the "events" edges to the NotificationEvent entity.

func (*NotificationEventDeliveryStatusUpdateOne) ClearEvents

ClearEvents clears all "events" edges to the NotificationEvent entity.

func (*NotificationEventDeliveryStatusUpdateOne) ClearReason

ClearReason clears the value of the "reason" field.

func (*NotificationEventDeliveryStatusUpdateOne) Exec

Exec executes the query on the entity.

func (*NotificationEventDeliveryStatusUpdateOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*NotificationEventDeliveryStatusUpdateOne) Mutation

Mutation returns the NotificationEventDeliveryStatusMutation object of the builder.

func (*NotificationEventDeliveryStatusUpdateOne) RemoveEventIDs

RemoveEventIDs removes the "events" edge to NotificationEvent entities by IDs.

func (*NotificationEventDeliveryStatusUpdateOne) RemoveEvents

RemoveEvents removes "events" edges to NotificationEvent entities.

func (*NotificationEventDeliveryStatusUpdateOne) Save

Save executes the query and returns the updated NotificationEventDeliveryStatus entity.

func (*NotificationEventDeliveryStatusUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*NotificationEventDeliveryStatusUpdateOne) Select

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*NotificationEventDeliveryStatusUpdateOne) SetNillableReason

SetNillableReason sets the "reason" field if the given value is not nil.

func (*NotificationEventDeliveryStatusUpdateOne) SetNillableState

SetNillableState sets the "state" field if the given value is not nil.

func (*NotificationEventDeliveryStatusUpdateOne) SetReason

SetReason sets the "reason" field.

func (*NotificationEventDeliveryStatusUpdateOne) SetState

SetState sets the "state" field.

func (*NotificationEventDeliveryStatusUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*NotificationEventDeliveryStatusUpdateOne) Where

Where appends a list predicates to the NotificationEventDeliveryStatusUpdate builder.

type NotificationEventDeliveryStatusUpsert

type NotificationEventDeliveryStatusUpsert struct {
	*sql.UpdateSet
}

NotificationEventDeliveryStatusUpsert is the "OnConflict" setter.

func (*NotificationEventDeliveryStatusUpsert) ClearReason

ClearReason clears the value of the "reason" field.

func (*NotificationEventDeliveryStatusUpsert) SetReason

SetReason sets the "reason" field.

func (*NotificationEventDeliveryStatusUpsert) SetState

SetState sets the "state" field.

func (*NotificationEventDeliveryStatusUpsert) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*NotificationEventDeliveryStatusUpsert) UpdateReason

UpdateReason sets the "reason" field to the value that was provided on create.

func (*NotificationEventDeliveryStatusUpsert) UpdateState

UpdateState sets the "state" field to the value that was provided on create.

func (*NotificationEventDeliveryStatusUpsert) UpdateUpdatedAt

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type NotificationEventDeliveryStatusUpsertBulk

type NotificationEventDeliveryStatusUpsertBulk struct {
	// contains filtered or unexported fields
}

NotificationEventDeliveryStatusUpsertBulk is the builder for "upsert"-ing a bulk of NotificationEventDeliveryStatus nodes.

func (*NotificationEventDeliveryStatusUpsertBulk) ClearReason

ClearReason clears the value of the "reason" field.

func (*NotificationEventDeliveryStatusUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*NotificationEventDeliveryStatusUpsertBulk) Exec

Exec executes the query.

func (*NotificationEventDeliveryStatusUpsertBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*NotificationEventDeliveryStatusUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.NotificationEventDeliveryStatus.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*NotificationEventDeliveryStatusUpsertBulk) SetReason

SetReason sets the "reason" field.

func (*NotificationEventDeliveryStatusUpsertBulk) SetState

SetState sets the "state" field.

func (*NotificationEventDeliveryStatusUpsertBulk) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*NotificationEventDeliveryStatusUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the NotificationEventDeliveryStatusCreateBulk.OnConflict documentation for more info.

func (*NotificationEventDeliveryStatusUpsertBulk) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.NotificationEventDeliveryStatus.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(notificationeventdeliverystatus.FieldID)
		}),
	).
	Exec(ctx)

func (*NotificationEventDeliveryStatusUpsertBulk) UpdateReason

UpdateReason sets the "reason" field to the value that was provided on create.

func (*NotificationEventDeliveryStatusUpsertBulk) UpdateState

UpdateState sets the "state" field to the value that was provided on create.

func (*NotificationEventDeliveryStatusUpsertBulk) UpdateUpdatedAt

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type NotificationEventDeliveryStatusUpsertOne

type NotificationEventDeliveryStatusUpsertOne struct {
	// contains filtered or unexported fields
}

NotificationEventDeliveryStatusUpsertOne is the builder for "upsert"-ing

one NotificationEventDeliveryStatus node.

func (*NotificationEventDeliveryStatusUpsertOne) ClearReason

ClearReason clears the value of the "reason" field.

func (*NotificationEventDeliveryStatusUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*NotificationEventDeliveryStatusUpsertOne) Exec

Exec executes the query.

func (*NotificationEventDeliveryStatusUpsertOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*NotificationEventDeliveryStatusUpsertOne) ID

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*NotificationEventDeliveryStatusUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*NotificationEventDeliveryStatusUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.NotificationEventDeliveryStatus.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*NotificationEventDeliveryStatusUpsertOne) SetReason

SetReason sets the "reason" field.

func (*NotificationEventDeliveryStatusUpsertOne) SetState

SetState sets the "state" field.

func (*NotificationEventDeliveryStatusUpsertOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*NotificationEventDeliveryStatusUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the NotificationEventDeliveryStatusCreate.OnConflict documentation for more info.

func (*NotificationEventDeliveryStatusUpsertOne) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.NotificationEventDeliveryStatus.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(notificationeventdeliverystatus.FieldID)
		}),
	).
	Exec(ctx)

func (*NotificationEventDeliveryStatusUpsertOne) UpdateReason

UpdateReason sets the "reason" field to the value that was provided on create.

func (*NotificationEventDeliveryStatusUpsertOne) UpdateState

UpdateState sets the "state" field to the value that was provided on create.

func (*NotificationEventDeliveryStatusUpsertOne) UpdateUpdatedAt

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type NotificationEventEdges

type NotificationEventEdges struct {
	// DeliveryStatuses holds the value of the delivery_statuses edge.
	DeliveryStatuses []*NotificationEventDeliveryStatus `json:"delivery_statuses,omitempty"`
	// Rules holds the value of the rules edge.
	Rules *NotificationRule `json:"rules,omitempty"`
	// contains filtered or unexported fields
}

NotificationEventEdges holds the relations/edges for other nodes in the graph.

func (NotificationEventEdges) DeliveryStatusesOrErr

func (e NotificationEventEdges) DeliveryStatusesOrErr() ([]*NotificationEventDeliveryStatus, error)

DeliveryStatusesOrErr returns the DeliveryStatuses value or an error if the edge was not loaded in eager-loading.

func (NotificationEventEdges) RulesOrErr

func (e NotificationEventEdges) RulesOrErr() (*NotificationRule, error)

RulesOrErr returns the Rules value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type NotificationEventGroupBy

type NotificationEventGroupBy struct {
	// contains filtered or unexported fields
}

NotificationEventGroupBy is the group-by builder for NotificationEvent entities.

func (*NotificationEventGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*NotificationEventGroupBy) Bool

func (s *NotificationEventGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NotificationEventGroupBy) BoolX

func (s *NotificationEventGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NotificationEventGroupBy) Bools

func (s *NotificationEventGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NotificationEventGroupBy) BoolsX

func (s *NotificationEventGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NotificationEventGroupBy) Float64

func (s *NotificationEventGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NotificationEventGroupBy) Float64X

func (s *NotificationEventGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NotificationEventGroupBy) Float64s

func (s *NotificationEventGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NotificationEventGroupBy) Float64sX

func (s *NotificationEventGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NotificationEventGroupBy) Int

func (s *NotificationEventGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NotificationEventGroupBy) IntX

func (s *NotificationEventGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NotificationEventGroupBy) Ints

func (s *NotificationEventGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NotificationEventGroupBy) IntsX

func (s *NotificationEventGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NotificationEventGroupBy) Scan

func (negb *NotificationEventGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*NotificationEventGroupBy) ScanX

func (s *NotificationEventGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*NotificationEventGroupBy) String

func (s *NotificationEventGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NotificationEventGroupBy) StringX

func (s *NotificationEventGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NotificationEventGroupBy) Strings

func (s *NotificationEventGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NotificationEventGroupBy) StringsX

func (s *NotificationEventGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NotificationEventMutation

type NotificationEventMutation struct {
	// contains filtered or unexported fields
}

NotificationEventMutation represents an operation that mutates the NotificationEvent nodes in the graph.

func (*NotificationEventMutation) AddDeliveryStatusIDs

func (m *NotificationEventMutation) AddDeliveryStatusIDs(ids ...string)

AddDeliveryStatusIDs adds the "delivery_statuses" edge to the NotificationEventDeliveryStatus entity by ids.

func (*NotificationEventMutation) AddField

func (m *NotificationEventMutation) 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 (*NotificationEventMutation) AddedEdges

func (m *NotificationEventMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*NotificationEventMutation) AddedField

func (m *NotificationEventMutation) 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 (*NotificationEventMutation) AddedFields

func (m *NotificationEventMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*NotificationEventMutation) AddedIDs

func (m *NotificationEventMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*NotificationEventMutation) Annotations

func (m *NotificationEventMutation) Annotations() (r map[string]interface{}, exists bool)

Annotations returns the value of the "annotations" field in the mutation.

func (*NotificationEventMutation) AnnotationsCleared

func (m *NotificationEventMutation) AnnotationsCleared() bool

AnnotationsCleared returns if the "annotations" field was cleared in this mutation.

func (*NotificationEventMutation) ClearAnnotations

func (m *NotificationEventMutation) ClearAnnotations()

ClearAnnotations clears the value of the "annotations" field.

func (*NotificationEventMutation) ClearDeliveryStatuses

func (m *NotificationEventMutation) ClearDeliveryStatuses()

ClearDeliveryStatuses clears the "delivery_statuses" edge to the NotificationEventDeliveryStatus entity.

func (*NotificationEventMutation) ClearEdge

func (m *NotificationEventMutation) 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 (*NotificationEventMutation) ClearField

func (m *NotificationEventMutation) 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 (*NotificationEventMutation) ClearRules

func (m *NotificationEventMutation) ClearRules()

ClearRules clears the "rules" edge to the NotificationRule entity.

func (*NotificationEventMutation) ClearedEdges

func (m *NotificationEventMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*NotificationEventMutation) ClearedFields

func (m *NotificationEventMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (NotificationEventMutation) Client

func (m NotificationEventMutation) 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 (*NotificationEventMutation) CreatedAt

func (m *NotificationEventMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*NotificationEventMutation) DeliveryStatusesCleared

func (m *NotificationEventMutation) DeliveryStatusesCleared() bool

DeliveryStatusesCleared reports if the "delivery_statuses" edge to the NotificationEventDeliveryStatus entity was cleared.

func (*NotificationEventMutation) DeliveryStatusesIDs

func (m *NotificationEventMutation) DeliveryStatusesIDs() (ids []string)

DeliveryStatusesIDs returns the "delivery_statuses" edge IDs in the mutation.

func (*NotificationEventMutation) EdgeCleared

func (m *NotificationEventMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*NotificationEventMutation) Field

func (m *NotificationEventMutation) 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 (*NotificationEventMutation) FieldCleared

func (m *NotificationEventMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*NotificationEventMutation) Fields

func (m *NotificationEventMutation) 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 (*NotificationEventMutation) GetType

func (m *NotificationEventMutation) GetType() (r notification.EventType, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*NotificationEventMutation) ID

func (m *NotificationEventMutation) ID() (id string, 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 (*NotificationEventMutation) IDs

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 (*NotificationEventMutation) Namespace

func (m *NotificationEventMutation) Namespace() (r string, exists bool)

Namespace returns the value of the "namespace" field in the mutation.

func (*NotificationEventMutation) OldAnnotations

func (m *NotificationEventMutation) OldAnnotations(ctx context.Context) (v map[string]interface{}, err error)

OldAnnotations returns the old "annotations" field's value of the NotificationEvent entity. If the NotificationEvent 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 (*NotificationEventMutation) OldCreatedAt

func (m *NotificationEventMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the NotificationEvent entity. If the NotificationEvent 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 (*NotificationEventMutation) OldField

func (m *NotificationEventMutation) 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 (*NotificationEventMutation) OldNamespace

func (m *NotificationEventMutation) OldNamespace(ctx context.Context) (v string, err error)

OldNamespace returns the old "namespace" field's value of the NotificationEvent entity. If the NotificationEvent 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 (*NotificationEventMutation) OldPayload

func (m *NotificationEventMutation) OldPayload(ctx context.Context) (v string, err error)

OldPayload returns the old "payload" field's value of the NotificationEvent entity. If the NotificationEvent 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 (*NotificationEventMutation) OldRuleID

func (m *NotificationEventMutation) OldRuleID(ctx context.Context) (v string, err error)

OldRuleID returns the old "rule_id" field's value of the NotificationEvent entity. If the NotificationEvent 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 (*NotificationEventMutation) OldType

OldType returns the old "type" field's value of the NotificationEvent entity. If the NotificationEvent 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 (*NotificationEventMutation) Op

func (m *NotificationEventMutation) Op() Op

Op returns the operation name.

func (*NotificationEventMutation) Payload

func (m *NotificationEventMutation) Payload() (r string, exists bool)

Payload returns the value of the "payload" field in the mutation.

func (*NotificationEventMutation) RemoveDeliveryStatusIDs

func (m *NotificationEventMutation) RemoveDeliveryStatusIDs(ids ...string)

RemoveDeliveryStatusIDs removes the "delivery_statuses" edge to the NotificationEventDeliveryStatus entity by IDs.

func (*NotificationEventMutation) RemovedDeliveryStatusesIDs

func (m *NotificationEventMutation) RemovedDeliveryStatusesIDs() (ids []string)

RemovedDeliveryStatuses returns the removed IDs of the "delivery_statuses" edge to the NotificationEventDeliveryStatus entity.

func (*NotificationEventMutation) RemovedEdges

func (m *NotificationEventMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*NotificationEventMutation) RemovedIDs

func (m *NotificationEventMutation) 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 (*NotificationEventMutation) ResetAnnotations

func (m *NotificationEventMutation) ResetAnnotations()

ResetAnnotations resets all changes to the "annotations" field.

func (*NotificationEventMutation) ResetCreatedAt

func (m *NotificationEventMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*NotificationEventMutation) ResetDeliveryStatuses

func (m *NotificationEventMutation) ResetDeliveryStatuses()

ResetDeliveryStatuses resets all changes to the "delivery_statuses" edge.

func (*NotificationEventMutation) ResetEdge

func (m *NotificationEventMutation) 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 (*NotificationEventMutation) ResetField

func (m *NotificationEventMutation) 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 (*NotificationEventMutation) ResetNamespace

func (m *NotificationEventMutation) ResetNamespace()

ResetNamespace resets all changes to the "namespace" field.

func (*NotificationEventMutation) ResetPayload

func (m *NotificationEventMutation) ResetPayload()

ResetPayload resets all changes to the "payload" field.

func (*NotificationEventMutation) ResetRuleID

func (m *NotificationEventMutation) ResetRuleID()

ResetRuleID resets all changes to the "rule_id" field.

func (*NotificationEventMutation) ResetRules

func (m *NotificationEventMutation) ResetRules()

ResetRules resets all changes to the "rules" edge.

func (*NotificationEventMutation) ResetType

func (m *NotificationEventMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*NotificationEventMutation) RuleID

func (m *NotificationEventMutation) RuleID() (r string, exists bool)

RuleID returns the value of the "rule_id" field in the mutation.

func (*NotificationEventMutation) RulesCleared

func (m *NotificationEventMutation) RulesCleared() bool

RulesCleared reports if the "rules" edge to the NotificationRule entity was cleared.

func (*NotificationEventMutation) RulesID

func (m *NotificationEventMutation) RulesID() (id string, exists bool)

RulesID returns the "rules" edge ID in the mutation.

func (*NotificationEventMutation) RulesIDs

func (m *NotificationEventMutation) RulesIDs() (ids []string)

RulesIDs returns the "rules" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use RulesID instead. It exists only for internal usage by the builders.

func (*NotificationEventMutation) SetAnnotations

func (m *NotificationEventMutation) SetAnnotations(value map[string]interface{})

SetAnnotations sets the "annotations" field.

func (*NotificationEventMutation) SetCreatedAt

func (m *NotificationEventMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*NotificationEventMutation) SetField

func (m *NotificationEventMutation) 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 (*NotificationEventMutation) SetID

func (m *NotificationEventMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of NotificationEvent entities.

func (*NotificationEventMutation) SetNamespace

func (m *NotificationEventMutation) SetNamespace(s string)

SetNamespace sets the "namespace" field.

func (*NotificationEventMutation) SetOp

func (m *NotificationEventMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*NotificationEventMutation) SetPayload

func (m *NotificationEventMutation) SetPayload(s string)

SetPayload sets the "payload" field.

func (*NotificationEventMutation) SetRuleID

func (m *NotificationEventMutation) SetRuleID(s string)

SetRuleID sets the "rule_id" field.

func (*NotificationEventMutation) SetRulesID

func (m *NotificationEventMutation) SetRulesID(id string)

SetRulesID sets the "rules" edge to the NotificationRule entity by id.

func (*NotificationEventMutation) SetType

SetType sets the "type" field.

func (NotificationEventMutation) Tx

func (m NotificationEventMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*NotificationEventMutation) Type

Type returns the node type of this mutation (NotificationEvent).

func (*NotificationEventMutation) Where

Where appends a list predicates to the NotificationEventMutation builder.

func (*NotificationEventMutation) WhereP

func (m *NotificationEventMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the NotificationEventMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type NotificationEventQuery

type NotificationEventQuery struct {
	// contains filtered or unexported fields
}

NotificationEventQuery is the builder for querying NotificationEvent entities.

func (*NotificationEventQuery) Aggregate

Aggregate returns a NotificationEventSelect configured with the given aggregations.

func (*NotificationEventQuery) All

All executes the query and returns a list of NotificationEvents.

func (*NotificationEventQuery) AllX

AllX is like All, but panics if an error occurs.

func (*NotificationEventQuery) Clone

Clone returns a duplicate of the NotificationEventQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*NotificationEventQuery) Count

func (neq *NotificationEventQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NotificationEventQuery) CountX

func (neq *NotificationEventQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*NotificationEventQuery) Exist

func (neq *NotificationEventQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*NotificationEventQuery) ExistX

func (neq *NotificationEventQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*NotificationEventQuery) First

First returns the first NotificationEvent entity from the query. Returns a *NotFoundError when no NotificationEvent was found.

func (*NotificationEventQuery) FirstID

func (neq *NotificationEventQuery) FirstID(ctx context.Context) (id string, err error)

FirstID returns the first NotificationEvent ID from the query. Returns a *NotFoundError when no NotificationEvent ID was found.

func (*NotificationEventQuery) FirstIDX

func (neq *NotificationEventQuery) FirstIDX(ctx context.Context) string

FirstIDX is like FirstID, but panics if an error occurs.

func (*NotificationEventQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*NotificationEventQuery) ForShare

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*NotificationEventQuery) ForUpdate

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*NotificationEventQuery) GroupBy

func (neq *NotificationEventQuery) GroupBy(field string, fields ...string) *NotificationEventGroupBy

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 {
	Namespace string `json:"namespace,omitempty"`
	Count int `json:"count,omitempty"`
}

client.NotificationEvent.Query().
	GroupBy(notificationevent.FieldNamespace).
	Aggregate(db.Count()).
	Scan(ctx, &v)

func (*NotificationEventQuery) IDs

func (neq *NotificationEventQuery) IDs(ctx context.Context) (ids []string, err error)

IDs executes the query and returns a list of NotificationEvent IDs.

func (*NotificationEventQuery) IDsX

func (neq *NotificationEventQuery) IDsX(ctx context.Context) []string

IDsX is like IDs, but panics if an error occurs.

func (*NotificationEventQuery) Limit

Limit the number of records to be returned by this query.

func (*NotificationEventQuery) Offset

func (neq *NotificationEventQuery) Offset(offset int) *NotificationEventQuery

Offset to start from.

func (*NotificationEventQuery) Only

Only returns a single NotificationEvent entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one NotificationEvent entity is found. Returns a *NotFoundError when no NotificationEvent entities are found.

func (*NotificationEventQuery) OnlyID

func (neq *NotificationEventQuery) OnlyID(ctx context.Context) (id string, err error)

OnlyID is like Only, but returns the only NotificationEvent ID in the query. Returns a *NotSingularError when more than one NotificationEvent ID is found. Returns a *NotFoundError when no entities are found.

func (*NotificationEventQuery) OnlyIDX

func (neq *NotificationEventQuery) OnlyIDX(ctx context.Context) string

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*NotificationEventQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*NotificationEventQuery) Order

Order specifies how the records should be ordered.

func (*NotificationEventQuery) Paginate

Paginate runs the query and returns a paginated response. If page is its 0 value then it will return all the items and populate the response page accordingly.

func (*NotificationEventQuery) QueryDeliveryStatuses

func (neq *NotificationEventQuery) QueryDeliveryStatuses() *NotificationEventDeliveryStatusQuery

QueryDeliveryStatuses chains the current query on the "delivery_statuses" edge.

func (*NotificationEventQuery) QueryRules

func (neq *NotificationEventQuery) QueryRules() *NotificationRuleQuery

QueryRules chains the current query on the "rules" edge.

func (*NotificationEventQuery) Select

func (neq *NotificationEventQuery) Select(fields ...string) *NotificationEventSelect

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 {
	Namespace string `json:"namespace,omitempty"`
}

client.NotificationEvent.Query().
	Select(notificationevent.FieldNamespace).
	Scan(ctx, &v)

func (*NotificationEventQuery) Unique

func (neq *NotificationEventQuery) Unique(unique bool) *NotificationEventQuery

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 (*NotificationEventQuery) Where

Where adds a new predicate for the NotificationEventQuery builder.

func (*NotificationEventQuery) WithDeliveryStatuses

func (neq *NotificationEventQuery) WithDeliveryStatuses(opts ...func(*NotificationEventDeliveryStatusQuery)) *NotificationEventQuery

WithDeliveryStatuses tells the query-builder to eager-load the nodes that are connected to the "delivery_statuses" edge. The optional arguments are used to configure the query builder of the edge.

func (*NotificationEventQuery) WithRules

WithRules tells the query-builder to eager-load the nodes that are connected to the "rules" edge. The optional arguments are used to configure the query builder of the edge.

type NotificationEventSelect

type NotificationEventSelect struct {
	*NotificationEventQuery
	// contains filtered or unexported fields
}

NotificationEventSelect is the builder for selecting fields of NotificationEvent entities.

func (*NotificationEventSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*NotificationEventSelect) Bool

func (s *NotificationEventSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NotificationEventSelect) BoolX

func (s *NotificationEventSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NotificationEventSelect) Bools

func (s *NotificationEventSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NotificationEventSelect) BoolsX

func (s *NotificationEventSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NotificationEventSelect) Float64

func (s *NotificationEventSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NotificationEventSelect) Float64X

func (s *NotificationEventSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NotificationEventSelect) Float64s

func (s *NotificationEventSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NotificationEventSelect) Float64sX

func (s *NotificationEventSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NotificationEventSelect) Int

func (s *NotificationEventSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NotificationEventSelect) IntX

func (s *NotificationEventSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NotificationEventSelect) Ints

func (s *NotificationEventSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NotificationEventSelect) IntsX

func (s *NotificationEventSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NotificationEventSelect) Scan

func (nes *NotificationEventSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*NotificationEventSelect) ScanX

func (s *NotificationEventSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*NotificationEventSelect) String

func (s *NotificationEventSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NotificationEventSelect) StringX

func (s *NotificationEventSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NotificationEventSelect) Strings

func (s *NotificationEventSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NotificationEventSelect) StringsX

func (s *NotificationEventSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NotificationEventUpdate

type NotificationEventUpdate struct {
	// contains filtered or unexported fields
}

NotificationEventUpdate is the builder for updating NotificationEvent entities.

func (*NotificationEventUpdate) AddDeliveryStatusIDs

func (neu *NotificationEventUpdate) AddDeliveryStatusIDs(ids ...string) *NotificationEventUpdate

AddDeliveryStatusIDs adds the "delivery_statuses" edge to the NotificationEventDeliveryStatus entity by IDs.

func (*NotificationEventUpdate) AddDeliveryStatuses

AddDeliveryStatuses adds the "delivery_statuses" edges to the NotificationEventDeliveryStatus entity.

func (*NotificationEventUpdate) ClearAnnotations

func (neu *NotificationEventUpdate) ClearAnnotations() *NotificationEventUpdate

ClearAnnotations clears the value of the "annotations" field.

func (*NotificationEventUpdate) ClearDeliveryStatuses

func (neu *NotificationEventUpdate) ClearDeliveryStatuses() *NotificationEventUpdate

ClearDeliveryStatuses clears all "delivery_statuses" edges to the NotificationEventDeliveryStatus entity.

func (*NotificationEventUpdate) Exec

Exec executes the query.

func (*NotificationEventUpdate) ExecX

func (neu *NotificationEventUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NotificationEventUpdate) Mutation

Mutation returns the NotificationEventMutation object of the builder.

func (*NotificationEventUpdate) RemoveDeliveryStatusIDs

func (neu *NotificationEventUpdate) RemoveDeliveryStatusIDs(ids ...string) *NotificationEventUpdate

RemoveDeliveryStatusIDs removes the "delivery_statuses" edge to NotificationEventDeliveryStatus entities by IDs.

func (*NotificationEventUpdate) RemoveDeliveryStatuses

RemoveDeliveryStatuses removes "delivery_statuses" edges to NotificationEventDeliveryStatus entities.

func (*NotificationEventUpdate) Save

func (neu *NotificationEventUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*NotificationEventUpdate) SaveX

func (neu *NotificationEventUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*NotificationEventUpdate) SetAnnotations

func (neu *NotificationEventUpdate) SetAnnotations(m map[string]interface{}) *NotificationEventUpdate

SetAnnotations sets the "annotations" field.

func (*NotificationEventUpdate) SetNillablePayload

func (neu *NotificationEventUpdate) SetNillablePayload(s *string) *NotificationEventUpdate

SetNillablePayload sets the "payload" field if the given value is not nil.

func (*NotificationEventUpdate) SetPayload

SetPayload sets the "payload" field.

func (*NotificationEventUpdate) Where

Where appends a list predicates to the NotificationEventUpdate builder.

type NotificationEventUpdateOne

type NotificationEventUpdateOne struct {
	// contains filtered or unexported fields
}

NotificationEventUpdateOne is the builder for updating a single NotificationEvent entity.

func (*NotificationEventUpdateOne) AddDeliveryStatusIDs

func (neuo *NotificationEventUpdateOne) AddDeliveryStatusIDs(ids ...string) *NotificationEventUpdateOne

AddDeliveryStatusIDs adds the "delivery_statuses" edge to the NotificationEventDeliveryStatus entity by IDs.

func (*NotificationEventUpdateOne) AddDeliveryStatuses

AddDeliveryStatuses adds the "delivery_statuses" edges to the NotificationEventDeliveryStatus entity.

func (*NotificationEventUpdateOne) ClearAnnotations

func (neuo *NotificationEventUpdateOne) ClearAnnotations() *NotificationEventUpdateOne

ClearAnnotations clears the value of the "annotations" field.

func (*NotificationEventUpdateOne) ClearDeliveryStatuses

func (neuo *NotificationEventUpdateOne) ClearDeliveryStatuses() *NotificationEventUpdateOne

ClearDeliveryStatuses clears all "delivery_statuses" edges to the NotificationEventDeliveryStatus entity.

func (*NotificationEventUpdateOne) Exec

Exec executes the query on the entity.

func (*NotificationEventUpdateOne) ExecX

func (neuo *NotificationEventUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NotificationEventUpdateOne) Mutation

Mutation returns the NotificationEventMutation object of the builder.

func (*NotificationEventUpdateOne) RemoveDeliveryStatusIDs

func (neuo *NotificationEventUpdateOne) RemoveDeliveryStatusIDs(ids ...string) *NotificationEventUpdateOne

RemoveDeliveryStatusIDs removes the "delivery_statuses" edge to NotificationEventDeliveryStatus entities by IDs.

func (*NotificationEventUpdateOne) RemoveDeliveryStatuses

RemoveDeliveryStatuses removes "delivery_statuses" edges to NotificationEventDeliveryStatus entities.

func (*NotificationEventUpdateOne) Save

Save executes the query and returns the updated NotificationEvent entity.

func (*NotificationEventUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*NotificationEventUpdateOne) Select

func (neuo *NotificationEventUpdateOne) Select(field string, fields ...string) *NotificationEventUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*NotificationEventUpdateOne) SetAnnotations

func (neuo *NotificationEventUpdateOne) SetAnnotations(m map[string]interface{}) *NotificationEventUpdateOne

SetAnnotations sets the "annotations" field.

func (*NotificationEventUpdateOne) SetNillablePayload

func (neuo *NotificationEventUpdateOne) SetNillablePayload(s *string) *NotificationEventUpdateOne

SetNillablePayload sets the "payload" field if the given value is not nil.

func (*NotificationEventUpdateOne) SetPayload

SetPayload sets the "payload" field.

func (*NotificationEventUpdateOne) Where

Where appends a list predicates to the NotificationEventUpdate builder.

type NotificationEventUpsert

type NotificationEventUpsert struct {
	*sql.UpdateSet
}

NotificationEventUpsert is the "OnConflict" setter.

func (*NotificationEventUpsert) ClearAnnotations

func (u *NotificationEventUpsert) ClearAnnotations() *NotificationEventUpsert

ClearAnnotations clears the value of the "annotations" field.

func (*NotificationEventUpsert) SetAnnotations

func (u *NotificationEventUpsert) SetAnnotations(v map[string]interface{}) *NotificationEventUpsert

SetAnnotations sets the "annotations" field.

func (*NotificationEventUpsert) SetPayload

SetPayload sets the "payload" field.

func (*NotificationEventUpsert) UpdateAnnotations

func (u *NotificationEventUpsert) UpdateAnnotations() *NotificationEventUpsert

UpdateAnnotations sets the "annotations" field to the value that was provided on create.

func (*NotificationEventUpsert) UpdatePayload

UpdatePayload sets the "payload" field to the value that was provided on create.

type NotificationEventUpsertBulk

type NotificationEventUpsertBulk struct {
	// contains filtered or unexported fields
}

NotificationEventUpsertBulk is the builder for "upsert"-ing a bulk of NotificationEvent nodes.

func (*NotificationEventUpsertBulk) ClearAnnotations

ClearAnnotations clears the value of the "annotations" field.

func (*NotificationEventUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*NotificationEventUpsertBulk) Exec

Exec executes the query.

func (*NotificationEventUpsertBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*NotificationEventUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.NotificationEvent.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*NotificationEventUpsertBulk) SetAnnotations

func (u *NotificationEventUpsertBulk) SetAnnotations(v map[string]interface{}) *NotificationEventUpsertBulk

SetAnnotations sets the "annotations" field.

func (*NotificationEventUpsertBulk) SetPayload

SetPayload sets the "payload" field.

func (*NotificationEventUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the NotificationEventCreateBulk.OnConflict documentation for more info.

func (*NotificationEventUpsertBulk) UpdateAnnotations

UpdateAnnotations sets the "annotations" field to the value that was provided on create.

func (*NotificationEventUpsertBulk) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.NotificationEvent.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(notificationevent.FieldID)
		}),
	).
	Exec(ctx)

func (*NotificationEventUpsertBulk) UpdatePayload

UpdatePayload sets the "payload" field to the value that was provided on create.

type NotificationEventUpsertOne

type NotificationEventUpsertOne struct {
	// contains filtered or unexported fields
}

NotificationEventUpsertOne is the builder for "upsert"-ing

one NotificationEvent node.

func (*NotificationEventUpsertOne) ClearAnnotations

ClearAnnotations clears the value of the "annotations" field.

func (*NotificationEventUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*NotificationEventUpsertOne) Exec

Exec executes the query.

func (*NotificationEventUpsertOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*NotificationEventUpsertOne) ID

func (u *NotificationEventUpsertOne) ID(ctx context.Context) (id string, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*NotificationEventUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*NotificationEventUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.NotificationEvent.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*NotificationEventUpsertOne) SetAnnotations

func (u *NotificationEventUpsertOne) SetAnnotations(v map[string]interface{}) *NotificationEventUpsertOne

SetAnnotations sets the "annotations" field.

func (*NotificationEventUpsertOne) SetPayload

SetPayload sets the "payload" field.

func (*NotificationEventUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the NotificationEventCreate.OnConflict documentation for more info.

func (*NotificationEventUpsertOne) UpdateAnnotations

UpdateAnnotations sets the "annotations" field to the value that was provided on create.

func (*NotificationEventUpsertOne) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.NotificationEvent.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(notificationevent.FieldID)
		}),
	).
	Exec(ctx)

func (*NotificationEventUpsertOne) UpdatePayload

UpdatePayload sets the "payload" field to the value that was provided on create.

type NotificationEvents

type NotificationEvents []*NotificationEvent

NotificationEvents is a parsable slice of NotificationEvent.

type NotificationRule

type NotificationRule struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// Namespace holds the value of the "namespace" field.
	Namespace string `json:"namespace,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"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// The event type the rule associated with
	Type notification.RuleType `json:"type,omitempty"`
	// The name of the rule
	Name string `json:"name,omitempty"`
	// Whether the rule is disabled or not
	Disabled bool `json:"disabled,omitempty"`
	// Config holds the value of the "config" field.
	Config notification.RuleConfig `json:"config,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the NotificationRuleQuery when eager-loading is set.
	Edges NotificationRuleEdges `json:"edges"`
	// contains filtered or unexported fields
}

NotificationRule is the model entity for the NotificationRule schema.

func (*NotificationRule) QueryChannels

func (nr *NotificationRule) QueryChannels() *NotificationChannelQuery

QueryChannels queries the "channels" edge of the NotificationRule entity.

func (*NotificationRule) QueryEvents

func (nr *NotificationRule) QueryEvents() *NotificationEventQuery

QueryEvents queries the "events" edge of the NotificationRule entity.

func (*NotificationRule) String

func (nr *NotificationRule) String() string

String implements the fmt.Stringer.

func (*NotificationRule) Unwrap

func (nr *NotificationRule) Unwrap() *NotificationRule

Unwrap unwraps the NotificationRule 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 (*NotificationRule) Update

Update returns a builder for updating this NotificationRule. Note that you need to call NotificationRule.Unwrap() before calling this method if this NotificationRule was returned from a transaction, and the transaction was committed or rolled back.

func (*NotificationRule) Value

func (nr *NotificationRule) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the NotificationRule. This includes values selected through modifiers, order, etc.

type NotificationRuleClient

type NotificationRuleClient struct {
	// contains filtered or unexported fields
}

NotificationRuleClient is a client for the NotificationRule schema.

func NewNotificationRuleClient

func NewNotificationRuleClient(c config) *NotificationRuleClient

NewNotificationRuleClient returns a client for the NotificationRule from the given config.

func (*NotificationRuleClient) Create

Create returns a builder for creating a NotificationRule entity.

func (*NotificationRuleClient) CreateBulk

CreateBulk returns a builder for creating a bulk of NotificationRule entities.

func (*NotificationRuleClient) Delete

Delete returns a delete builder for NotificationRule.

func (*NotificationRuleClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*NotificationRuleClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*NotificationRuleClient) Get

Get returns a NotificationRule entity by its id.

func (*NotificationRuleClient) GetX

GetX is like Get, but panics if an error occurs.

func (*NotificationRuleClient) Hooks

func (c *NotificationRuleClient) Hooks() []Hook

Hooks returns the client hooks.

func (*NotificationRuleClient) Intercept

func (c *NotificationRuleClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `notificationrule.Intercept(f(g(h())))`.

func (*NotificationRuleClient) Interceptors

func (c *NotificationRuleClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*NotificationRuleClient) MapCreateBulk

func (c *NotificationRuleClient) MapCreateBulk(slice any, setFunc func(*NotificationRuleCreate, int)) *NotificationRuleCreateBulk

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 (*NotificationRuleClient) Query

Query returns a query builder for NotificationRule.

func (*NotificationRuleClient) QueryChannels

QueryChannels queries the channels edge of a NotificationRule.

func (*NotificationRuleClient) QueryEvents

QueryEvents queries the events edge of a NotificationRule.

func (*NotificationRuleClient) Update

Update returns an update builder for NotificationRule.

func (*NotificationRuleClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*NotificationRuleClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*NotificationRuleClient) Use

func (c *NotificationRuleClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `notificationrule.Hooks(f(g(h())))`.

type NotificationRuleCreate

type NotificationRuleCreate struct {
	// contains filtered or unexported fields
}

NotificationRuleCreate is the builder for creating a NotificationRule entity.

func (*NotificationRuleCreate) AddChannelIDs

func (nrc *NotificationRuleCreate) AddChannelIDs(ids ...string) *NotificationRuleCreate

AddChannelIDs adds the "channels" edge to the NotificationChannel entity by IDs.

func (*NotificationRuleCreate) AddChannels

AddChannels adds the "channels" edges to the NotificationChannel entity.

func (*NotificationRuleCreate) AddEventIDs

func (nrc *NotificationRuleCreate) AddEventIDs(ids ...string) *NotificationRuleCreate

AddEventIDs adds the "events" edge to the NotificationEvent entity by IDs.

func (*NotificationRuleCreate) AddEvents

AddEvents adds the "events" edges to the NotificationEvent entity.

func (*NotificationRuleCreate) Exec

Exec executes the query.

func (*NotificationRuleCreate) ExecX

func (nrc *NotificationRuleCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NotificationRuleCreate) Mutation

Mutation returns the NotificationRuleMutation object of the builder.

func (*NotificationRuleCreate) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.NotificationRule.Create().
	SetNamespace(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.NotificationRuleUpsert) {
		SetNamespace(v+v).
	}).
	Exec(ctx)

func (*NotificationRuleCreate) OnConflictColumns

func (nrc *NotificationRuleCreate) OnConflictColumns(columns ...string) *NotificationRuleUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.NotificationRule.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*NotificationRuleCreate) Save

Save creates the NotificationRule in the database.

func (*NotificationRuleCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*NotificationRuleCreate) SetConfig

SetConfig sets the "config" field.

func (*NotificationRuleCreate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*NotificationRuleCreate) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*NotificationRuleCreate) SetDisabled

func (nrc *NotificationRuleCreate) SetDisabled(b bool) *NotificationRuleCreate

SetDisabled sets the "disabled" field.

func (*NotificationRuleCreate) SetID

SetID sets the "id" field.

func (*NotificationRuleCreate) SetName

SetName sets the "name" field.

func (*NotificationRuleCreate) SetNamespace

SetNamespace sets the "namespace" field.

func (*NotificationRuleCreate) SetNillableCreatedAt

func (nrc *NotificationRuleCreate) SetNillableCreatedAt(t *time.Time) *NotificationRuleCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*NotificationRuleCreate) SetNillableDeletedAt

func (nrc *NotificationRuleCreate) SetNillableDeletedAt(t *time.Time) *NotificationRuleCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*NotificationRuleCreate) SetNillableDisabled

func (nrc *NotificationRuleCreate) SetNillableDisabled(b *bool) *NotificationRuleCreate

SetNillableDisabled sets the "disabled" field if the given value is not nil.

func (*NotificationRuleCreate) SetNillableID

func (nrc *NotificationRuleCreate) SetNillableID(s *string) *NotificationRuleCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*NotificationRuleCreate) SetNillableUpdatedAt

func (nrc *NotificationRuleCreate) SetNillableUpdatedAt(t *time.Time) *NotificationRuleCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*NotificationRuleCreate) SetType

SetType sets the "type" field.

func (*NotificationRuleCreate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

type NotificationRuleCreateBulk

type NotificationRuleCreateBulk struct {
	// contains filtered or unexported fields
}

NotificationRuleCreateBulk is the builder for creating many NotificationRule entities in bulk.

func (*NotificationRuleCreateBulk) Exec

Exec executes the query.

func (*NotificationRuleCreateBulk) ExecX

func (nrcb *NotificationRuleCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NotificationRuleCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.NotificationRule.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.NotificationRuleUpsert) {
		SetNamespace(v+v).
	}).
	Exec(ctx)

func (*NotificationRuleCreateBulk) OnConflictColumns

func (nrcb *NotificationRuleCreateBulk) OnConflictColumns(columns ...string) *NotificationRuleUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.NotificationRule.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*NotificationRuleCreateBulk) Save

Save creates the NotificationRule entities in the database.

func (*NotificationRuleCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type NotificationRuleDelete

type NotificationRuleDelete struct {
	// contains filtered or unexported fields
}

NotificationRuleDelete is the builder for deleting a NotificationRule entity.

func (*NotificationRuleDelete) Exec

func (nrd *NotificationRuleDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*NotificationRuleDelete) ExecX

func (nrd *NotificationRuleDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*NotificationRuleDelete) Where

Where appends a list predicates to the NotificationRuleDelete builder.

type NotificationRuleDeleteOne

type NotificationRuleDeleteOne struct {
	// contains filtered or unexported fields
}

NotificationRuleDeleteOne is the builder for deleting a single NotificationRule entity.

func (*NotificationRuleDeleteOne) Exec

Exec executes the deletion query.

func (*NotificationRuleDeleteOne) ExecX

func (nrdo *NotificationRuleDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NotificationRuleDeleteOne) Where

Where appends a list predicates to the NotificationRuleDelete builder.

type NotificationRuleEdges

type NotificationRuleEdges struct {
	// Channels holds the value of the channels edge.
	Channels []*NotificationChannel `json:"channels,omitempty"`
	// Events holds the value of the events edge.
	Events []*NotificationEvent `json:"events,omitempty"`
	// contains filtered or unexported fields
}

NotificationRuleEdges holds the relations/edges for other nodes in the graph.

func (NotificationRuleEdges) ChannelsOrErr

func (e NotificationRuleEdges) ChannelsOrErr() ([]*NotificationChannel, error)

ChannelsOrErr returns the Channels value or an error if the edge was not loaded in eager-loading.

func (NotificationRuleEdges) EventsOrErr

func (e NotificationRuleEdges) EventsOrErr() ([]*NotificationEvent, error)

EventsOrErr returns the Events value or an error if the edge was not loaded in eager-loading.

type NotificationRuleGroupBy

type NotificationRuleGroupBy struct {
	// contains filtered or unexported fields
}

NotificationRuleGroupBy is the group-by builder for NotificationRule entities.

func (*NotificationRuleGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*NotificationRuleGroupBy) Bool

func (s *NotificationRuleGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NotificationRuleGroupBy) BoolX

func (s *NotificationRuleGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NotificationRuleGroupBy) Bools

func (s *NotificationRuleGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NotificationRuleGroupBy) BoolsX

func (s *NotificationRuleGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NotificationRuleGroupBy) Float64

func (s *NotificationRuleGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NotificationRuleGroupBy) Float64X

func (s *NotificationRuleGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NotificationRuleGroupBy) Float64s

func (s *NotificationRuleGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NotificationRuleGroupBy) Float64sX

func (s *NotificationRuleGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NotificationRuleGroupBy) Int

func (s *NotificationRuleGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NotificationRuleGroupBy) IntX

func (s *NotificationRuleGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NotificationRuleGroupBy) Ints

func (s *NotificationRuleGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NotificationRuleGroupBy) IntsX

func (s *NotificationRuleGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NotificationRuleGroupBy) Scan

func (nrgb *NotificationRuleGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*NotificationRuleGroupBy) ScanX

func (s *NotificationRuleGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*NotificationRuleGroupBy) String

func (s *NotificationRuleGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NotificationRuleGroupBy) StringX

func (s *NotificationRuleGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NotificationRuleGroupBy) Strings

func (s *NotificationRuleGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NotificationRuleGroupBy) StringsX

func (s *NotificationRuleGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NotificationRuleMutation

type NotificationRuleMutation struct {
	// contains filtered or unexported fields
}

NotificationRuleMutation represents an operation that mutates the NotificationRule nodes in the graph.

func (*NotificationRuleMutation) AddChannelIDs

func (m *NotificationRuleMutation) AddChannelIDs(ids ...string)

AddChannelIDs adds the "channels" edge to the NotificationChannel entity by ids.

func (*NotificationRuleMutation) AddEventIDs

func (m *NotificationRuleMutation) AddEventIDs(ids ...string)

AddEventIDs adds the "events" edge to the NotificationEvent entity by ids.

func (*NotificationRuleMutation) AddField

func (m *NotificationRuleMutation) 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 (*NotificationRuleMutation) AddedEdges

func (m *NotificationRuleMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*NotificationRuleMutation) AddedField

func (m *NotificationRuleMutation) 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 (*NotificationRuleMutation) AddedFields

func (m *NotificationRuleMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*NotificationRuleMutation) AddedIDs

func (m *NotificationRuleMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*NotificationRuleMutation) ChannelsCleared

func (m *NotificationRuleMutation) ChannelsCleared() bool

ChannelsCleared reports if the "channels" edge to the NotificationChannel entity was cleared.

func (*NotificationRuleMutation) ChannelsIDs

func (m *NotificationRuleMutation) ChannelsIDs() (ids []string)

ChannelsIDs returns the "channels" edge IDs in the mutation.

func (*NotificationRuleMutation) ClearChannels

func (m *NotificationRuleMutation) ClearChannels()

ClearChannels clears the "channels" edge to the NotificationChannel entity.

func (*NotificationRuleMutation) ClearDeletedAt

func (m *NotificationRuleMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*NotificationRuleMutation) ClearDisabled

func (m *NotificationRuleMutation) ClearDisabled()

ClearDisabled clears the value of the "disabled" field.

func (*NotificationRuleMutation) ClearEdge

func (m *NotificationRuleMutation) 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 (*NotificationRuleMutation) ClearEvents

func (m *NotificationRuleMutation) ClearEvents()

ClearEvents clears the "events" edge to the NotificationEvent entity.

func (*NotificationRuleMutation) ClearField

func (m *NotificationRuleMutation) 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 (*NotificationRuleMutation) ClearedEdges

func (m *NotificationRuleMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*NotificationRuleMutation) ClearedFields

func (m *NotificationRuleMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (NotificationRuleMutation) Client

func (m NotificationRuleMutation) 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 (*NotificationRuleMutation) Config

func (m *NotificationRuleMutation) Config() (r notification.RuleConfig, exists bool)

Config returns the value of the "config" field in the mutation.

func (*NotificationRuleMutation) CreatedAt

func (m *NotificationRuleMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*NotificationRuleMutation) DeletedAt

func (m *NotificationRuleMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*NotificationRuleMutation) DeletedAtCleared

func (m *NotificationRuleMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*NotificationRuleMutation) Disabled

func (m *NotificationRuleMutation) Disabled() (r bool, exists bool)

Disabled returns the value of the "disabled" field in the mutation.

func (*NotificationRuleMutation) DisabledCleared

func (m *NotificationRuleMutation) DisabledCleared() bool

DisabledCleared returns if the "disabled" field was cleared in this mutation.

func (*NotificationRuleMutation) EdgeCleared

func (m *NotificationRuleMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*NotificationRuleMutation) EventsCleared

func (m *NotificationRuleMutation) EventsCleared() bool

EventsCleared reports if the "events" edge to the NotificationEvent entity was cleared.

func (*NotificationRuleMutation) EventsIDs

func (m *NotificationRuleMutation) EventsIDs() (ids []string)

EventsIDs returns the "events" edge IDs in the mutation.

func (*NotificationRuleMutation) Field

func (m *NotificationRuleMutation) 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 (*NotificationRuleMutation) FieldCleared

func (m *NotificationRuleMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*NotificationRuleMutation) Fields

func (m *NotificationRuleMutation) 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 (*NotificationRuleMutation) GetType

func (m *NotificationRuleMutation) GetType() (r notification.RuleType, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*NotificationRuleMutation) ID

func (m *NotificationRuleMutation) ID() (id string, 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 (*NotificationRuleMutation) IDs

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 (*NotificationRuleMutation) Name

func (m *NotificationRuleMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*NotificationRuleMutation) Namespace

func (m *NotificationRuleMutation) Namespace() (r string, exists bool)

Namespace returns the value of the "namespace" field in the mutation.

func (*NotificationRuleMutation) OldConfig

OldConfig returns the old "config" field's value of the NotificationRule entity. If the NotificationRule 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 (*NotificationRuleMutation) OldCreatedAt

func (m *NotificationRuleMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the NotificationRule entity. If the NotificationRule 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 (*NotificationRuleMutation) OldDeletedAt

func (m *NotificationRuleMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the NotificationRule entity. If the NotificationRule 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 (*NotificationRuleMutation) OldDisabled

func (m *NotificationRuleMutation) OldDisabled(ctx context.Context) (v bool, err error)

OldDisabled returns the old "disabled" field's value of the NotificationRule entity. If the NotificationRule 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 (*NotificationRuleMutation) OldField

func (m *NotificationRuleMutation) 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 (*NotificationRuleMutation) OldName

func (m *NotificationRuleMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the NotificationRule entity. If the NotificationRule 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 (*NotificationRuleMutation) OldNamespace

func (m *NotificationRuleMutation) OldNamespace(ctx context.Context) (v string, err error)

OldNamespace returns the old "namespace" field's value of the NotificationRule entity. If the NotificationRule 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 (*NotificationRuleMutation) OldType

OldType returns the old "type" field's value of the NotificationRule entity. If the NotificationRule 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 (*NotificationRuleMutation) OldUpdatedAt

func (m *NotificationRuleMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the NotificationRule entity. If the NotificationRule 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 (*NotificationRuleMutation) Op

func (m *NotificationRuleMutation) Op() Op

Op returns the operation name.

func (*NotificationRuleMutation) RemoveChannelIDs

func (m *NotificationRuleMutation) RemoveChannelIDs(ids ...string)

RemoveChannelIDs removes the "channels" edge to the NotificationChannel entity by IDs.

func (*NotificationRuleMutation) RemoveEventIDs

func (m *NotificationRuleMutation) RemoveEventIDs(ids ...string)

RemoveEventIDs removes the "events" edge to the NotificationEvent entity by IDs.

func (*NotificationRuleMutation) RemovedChannelsIDs

func (m *NotificationRuleMutation) RemovedChannelsIDs() (ids []string)

RemovedChannels returns the removed IDs of the "channels" edge to the NotificationChannel entity.

func (*NotificationRuleMutation) RemovedEdges

func (m *NotificationRuleMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*NotificationRuleMutation) RemovedEventsIDs

func (m *NotificationRuleMutation) RemovedEventsIDs() (ids []string)

RemovedEvents returns the removed IDs of the "events" edge to the NotificationEvent entity.

func (*NotificationRuleMutation) RemovedIDs

func (m *NotificationRuleMutation) 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 (*NotificationRuleMutation) ResetChannels

func (m *NotificationRuleMutation) ResetChannels()

ResetChannels resets all changes to the "channels" edge.

func (*NotificationRuleMutation) ResetConfig

func (m *NotificationRuleMutation) ResetConfig()

ResetConfig resets all changes to the "config" field.

func (*NotificationRuleMutation) ResetCreatedAt

func (m *NotificationRuleMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*NotificationRuleMutation) ResetDeletedAt

func (m *NotificationRuleMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*NotificationRuleMutation) ResetDisabled

func (m *NotificationRuleMutation) ResetDisabled()

ResetDisabled resets all changes to the "disabled" field.

func (*NotificationRuleMutation) ResetEdge

func (m *NotificationRuleMutation) 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 (*NotificationRuleMutation) ResetEvents

func (m *NotificationRuleMutation) ResetEvents()

ResetEvents resets all changes to the "events" edge.

func (*NotificationRuleMutation) ResetField

func (m *NotificationRuleMutation) 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 (*NotificationRuleMutation) ResetName

func (m *NotificationRuleMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*NotificationRuleMutation) ResetNamespace

func (m *NotificationRuleMutation) ResetNamespace()

ResetNamespace resets all changes to the "namespace" field.

func (*NotificationRuleMutation) ResetType

func (m *NotificationRuleMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*NotificationRuleMutation) ResetUpdatedAt

func (m *NotificationRuleMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*NotificationRuleMutation) SetConfig

SetConfig sets the "config" field.

func (*NotificationRuleMutation) SetCreatedAt

func (m *NotificationRuleMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*NotificationRuleMutation) SetDeletedAt

func (m *NotificationRuleMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*NotificationRuleMutation) SetDisabled

func (m *NotificationRuleMutation) SetDisabled(b bool)

SetDisabled sets the "disabled" field.

func (*NotificationRuleMutation) SetField

func (m *NotificationRuleMutation) 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 (*NotificationRuleMutation) SetID

func (m *NotificationRuleMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of NotificationRule entities.

func (*NotificationRuleMutation) SetName

func (m *NotificationRuleMutation) SetName(s string)

SetName sets the "name" field.

func (*NotificationRuleMutation) SetNamespace

func (m *NotificationRuleMutation) SetNamespace(s string)

SetNamespace sets the "namespace" field.

func (*NotificationRuleMutation) SetOp

func (m *NotificationRuleMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*NotificationRuleMutation) SetType

SetType sets the "type" field.

func (*NotificationRuleMutation) SetUpdatedAt

func (m *NotificationRuleMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (NotificationRuleMutation) Tx

func (m NotificationRuleMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*NotificationRuleMutation) Type

func (m *NotificationRuleMutation) Type() string

Type returns the node type of this mutation (NotificationRule).

func (*NotificationRuleMutation) UpdatedAt

func (m *NotificationRuleMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*NotificationRuleMutation) Where

Where appends a list predicates to the NotificationRuleMutation builder.

func (*NotificationRuleMutation) WhereP

func (m *NotificationRuleMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the NotificationRuleMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type NotificationRuleQuery

type NotificationRuleQuery struct {
	// contains filtered or unexported fields
}

NotificationRuleQuery is the builder for querying NotificationRule entities.

func (*NotificationRuleQuery) Aggregate

Aggregate returns a NotificationRuleSelect configured with the given aggregations.

func (*NotificationRuleQuery) All

All executes the query and returns a list of NotificationRules.

func (*NotificationRuleQuery) AllX

AllX is like All, but panics if an error occurs.

func (*NotificationRuleQuery) Clone

Clone returns a duplicate of the NotificationRuleQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*NotificationRuleQuery) Count

func (nrq *NotificationRuleQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NotificationRuleQuery) CountX

func (nrq *NotificationRuleQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*NotificationRuleQuery) Exist

func (nrq *NotificationRuleQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*NotificationRuleQuery) ExistX

func (nrq *NotificationRuleQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*NotificationRuleQuery) First

First returns the first NotificationRule entity from the query. Returns a *NotFoundError when no NotificationRule was found.

func (*NotificationRuleQuery) FirstID

func (nrq *NotificationRuleQuery) FirstID(ctx context.Context) (id string, err error)

FirstID returns the first NotificationRule ID from the query. Returns a *NotFoundError when no NotificationRule ID was found.

func (*NotificationRuleQuery) FirstIDX

func (nrq *NotificationRuleQuery) FirstIDX(ctx context.Context) string

FirstIDX is like FirstID, but panics if an error occurs.

func (*NotificationRuleQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*NotificationRuleQuery) ForShare

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*NotificationRuleQuery) ForUpdate

func (nrq *NotificationRuleQuery) ForUpdate(opts ...sql.LockOption) *NotificationRuleQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*NotificationRuleQuery) GroupBy

func (nrq *NotificationRuleQuery) GroupBy(field string, fields ...string) *NotificationRuleGroupBy

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 {
	Namespace string `json:"namespace,omitempty"`
	Count int `json:"count,omitempty"`
}

client.NotificationRule.Query().
	GroupBy(notificationrule.FieldNamespace).
	Aggregate(db.Count()).
	Scan(ctx, &v)

func (*NotificationRuleQuery) IDs

func (nrq *NotificationRuleQuery) IDs(ctx context.Context) (ids []string, err error)

IDs executes the query and returns a list of NotificationRule IDs.

func (*NotificationRuleQuery) IDsX

func (nrq *NotificationRuleQuery) IDsX(ctx context.Context) []string

IDsX is like IDs, but panics if an error occurs.

func (*NotificationRuleQuery) Limit

func (nrq *NotificationRuleQuery) Limit(limit int) *NotificationRuleQuery

Limit the number of records to be returned by this query.

func (*NotificationRuleQuery) Offset

func (nrq *NotificationRuleQuery) Offset(offset int) *NotificationRuleQuery

Offset to start from.

func (*NotificationRuleQuery) Only

Only returns a single NotificationRule entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one NotificationRule entity is found. Returns a *NotFoundError when no NotificationRule entities are found.

func (*NotificationRuleQuery) OnlyID

func (nrq *NotificationRuleQuery) OnlyID(ctx context.Context) (id string, err error)

OnlyID is like Only, but returns the only NotificationRule ID in the query. Returns a *NotSingularError when more than one NotificationRule ID is found. Returns a *NotFoundError when no entities are found.

func (*NotificationRuleQuery) OnlyIDX

func (nrq *NotificationRuleQuery) OnlyIDX(ctx context.Context) string

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*NotificationRuleQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*NotificationRuleQuery) Order

Order specifies how the records should be ordered.

func (*NotificationRuleQuery) Paginate

Paginate runs the query and returns a paginated response. If page is its 0 value then it will return all the items and populate the response page accordingly.

func (*NotificationRuleQuery) QueryChannels

func (nrq *NotificationRuleQuery) QueryChannels() *NotificationChannelQuery

QueryChannels chains the current query on the "channels" edge.

func (*NotificationRuleQuery) QueryEvents

func (nrq *NotificationRuleQuery) QueryEvents() *NotificationEventQuery

QueryEvents chains the current query on the "events" edge.

func (*NotificationRuleQuery) Select

func (nrq *NotificationRuleQuery) Select(fields ...string) *NotificationRuleSelect

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 {
	Namespace string `json:"namespace,omitempty"`
}

client.NotificationRule.Query().
	Select(notificationrule.FieldNamespace).
	Scan(ctx, &v)

func (*NotificationRuleQuery) Unique

func (nrq *NotificationRuleQuery) Unique(unique bool) *NotificationRuleQuery

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 (*NotificationRuleQuery) Where

Where adds a new predicate for the NotificationRuleQuery builder.

func (*NotificationRuleQuery) WithChannels

func (nrq *NotificationRuleQuery) WithChannels(opts ...func(*NotificationChannelQuery)) *NotificationRuleQuery

WithChannels tells the query-builder to eager-load the nodes that are connected to the "channels" edge. The optional arguments are used to configure the query builder of the edge.

func (*NotificationRuleQuery) WithEvents

func (nrq *NotificationRuleQuery) WithEvents(opts ...func(*NotificationEventQuery)) *NotificationRuleQuery

WithEvents tells the query-builder to eager-load the nodes that are connected to the "events" edge. The optional arguments are used to configure the query builder of the edge.

type NotificationRuleSelect

type NotificationRuleSelect struct {
	*NotificationRuleQuery
	// contains filtered or unexported fields
}

NotificationRuleSelect is the builder for selecting fields of NotificationRule entities.

func (*NotificationRuleSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*NotificationRuleSelect) Bool

func (s *NotificationRuleSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NotificationRuleSelect) BoolX

func (s *NotificationRuleSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NotificationRuleSelect) Bools

func (s *NotificationRuleSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NotificationRuleSelect) BoolsX

func (s *NotificationRuleSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NotificationRuleSelect) Float64

func (s *NotificationRuleSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NotificationRuleSelect) Float64X

func (s *NotificationRuleSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NotificationRuleSelect) Float64s

func (s *NotificationRuleSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NotificationRuleSelect) Float64sX

func (s *NotificationRuleSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NotificationRuleSelect) Int

func (s *NotificationRuleSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NotificationRuleSelect) IntX

func (s *NotificationRuleSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NotificationRuleSelect) Ints

func (s *NotificationRuleSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NotificationRuleSelect) IntsX

func (s *NotificationRuleSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NotificationRuleSelect) Scan

func (nrs *NotificationRuleSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*NotificationRuleSelect) ScanX

func (s *NotificationRuleSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*NotificationRuleSelect) String

func (s *NotificationRuleSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NotificationRuleSelect) StringX

func (s *NotificationRuleSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NotificationRuleSelect) Strings

func (s *NotificationRuleSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NotificationRuleSelect) StringsX

func (s *NotificationRuleSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NotificationRuleUpdate

type NotificationRuleUpdate struct {
	// contains filtered or unexported fields
}

NotificationRuleUpdate is the builder for updating NotificationRule entities.

func (*NotificationRuleUpdate) AddChannelIDs

func (nru *NotificationRuleUpdate) AddChannelIDs(ids ...string) *NotificationRuleUpdate

AddChannelIDs adds the "channels" edge to the NotificationChannel entity by IDs.

func (*NotificationRuleUpdate) AddChannels

AddChannels adds the "channels" edges to the NotificationChannel entity.

func (*NotificationRuleUpdate) AddEventIDs

func (nru *NotificationRuleUpdate) AddEventIDs(ids ...string) *NotificationRuleUpdate

AddEventIDs adds the "events" edge to the NotificationEvent entity by IDs.

func (*NotificationRuleUpdate) AddEvents

AddEvents adds the "events" edges to the NotificationEvent entity.

func (*NotificationRuleUpdate) ClearChannels

func (nru *NotificationRuleUpdate) ClearChannels() *NotificationRuleUpdate

ClearChannels clears all "channels" edges to the NotificationChannel entity.

func (*NotificationRuleUpdate) ClearDeletedAt

func (nru *NotificationRuleUpdate) ClearDeletedAt() *NotificationRuleUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*NotificationRuleUpdate) ClearDisabled

func (nru *NotificationRuleUpdate) ClearDisabled() *NotificationRuleUpdate

ClearDisabled clears the value of the "disabled" field.

func (*NotificationRuleUpdate) ClearEvents

func (nru *NotificationRuleUpdate) ClearEvents() *NotificationRuleUpdate

ClearEvents clears all "events" edges to the NotificationEvent entity.

func (*NotificationRuleUpdate) Exec

Exec executes the query.

func (*NotificationRuleUpdate) ExecX

func (nru *NotificationRuleUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NotificationRuleUpdate) Mutation

Mutation returns the NotificationRuleMutation object of the builder.

func (*NotificationRuleUpdate) RemoveChannelIDs

func (nru *NotificationRuleUpdate) RemoveChannelIDs(ids ...string) *NotificationRuleUpdate

RemoveChannelIDs removes the "channels" edge to NotificationChannel entities by IDs.

func (*NotificationRuleUpdate) RemoveChannels

RemoveChannels removes "channels" edges to NotificationChannel entities.

func (*NotificationRuleUpdate) RemoveEventIDs

func (nru *NotificationRuleUpdate) RemoveEventIDs(ids ...string) *NotificationRuleUpdate

RemoveEventIDs removes the "events" edge to NotificationEvent entities by IDs.

func (*NotificationRuleUpdate) RemoveEvents

RemoveEvents removes "events" edges to NotificationEvent entities.

func (*NotificationRuleUpdate) Save

func (nru *NotificationRuleUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*NotificationRuleUpdate) SaveX

func (nru *NotificationRuleUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*NotificationRuleUpdate) SetConfig

SetConfig sets the "config" field.

func (*NotificationRuleUpdate) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*NotificationRuleUpdate) SetDisabled

func (nru *NotificationRuleUpdate) SetDisabled(b bool) *NotificationRuleUpdate

SetDisabled sets the "disabled" field.

func (*NotificationRuleUpdate) SetName

SetName sets the "name" field.

func (*NotificationRuleUpdate) SetNillableConfig

SetNillableConfig sets the "config" field if the given value is not nil.

func (*NotificationRuleUpdate) SetNillableDeletedAt

func (nru *NotificationRuleUpdate) SetNillableDeletedAt(t *time.Time) *NotificationRuleUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*NotificationRuleUpdate) SetNillableDisabled

func (nru *NotificationRuleUpdate) SetNillableDisabled(b *bool) *NotificationRuleUpdate

SetNillableDisabled sets the "disabled" field if the given value is not nil.

func (*NotificationRuleUpdate) SetNillableName

func (nru *NotificationRuleUpdate) SetNillableName(s *string) *NotificationRuleUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*NotificationRuleUpdate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*NotificationRuleUpdate) Where

Where appends a list predicates to the NotificationRuleUpdate builder.

type NotificationRuleUpdateOne

type NotificationRuleUpdateOne struct {
	// contains filtered or unexported fields
}

NotificationRuleUpdateOne is the builder for updating a single NotificationRule entity.

func (*NotificationRuleUpdateOne) AddChannelIDs

func (nruo *NotificationRuleUpdateOne) AddChannelIDs(ids ...string) *NotificationRuleUpdateOne

AddChannelIDs adds the "channels" edge to the NotificationChannel entity by IDs.

func (*NotificationRuleUpdateOne) AddChannels

AddChannels adds the "channels" edges to the NotificationChannel entity.

func (*NotificationRuleUpdateOne) AddEventIDs

func (nruo *NotificationRuleUpdateOne) AddEventIDs(ids ...string) *NotificationRuleUpdateOne

AddEventIDs adds the "events" edge to the NotificationEvent entity by IDs.

func (*NotificationRuleUpdateOne) AddEvents

AddEvents adds the "events" edges to the NotificationEvent entity.

func (*NotificationRuleUpdateOne) ClearChannels

ClearChannels clears all "channels" edges to the NotificationChannel entity.

func (*NotificationRuleUpdateOne) ClearDeletedAt

func (nruo *NotificationRuleUpdateOne) ClearDeletedAt() *NotificationRuleUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*NotificationRuleUpdateOne) ClearDisabled

ClearDisabled clears the value of the "disabled" field.

func (*NotificationRuleUpdateOne) ClearEvents

ClearEvents clears all "events" edges to the NotificationEvent entity.

func (*NotificationRuleUpdateOne) Exec

Exec executes the query on the entity.

func (*NotificationRuleUpdateOne) ExecX

func (nruo *NotificationRuleUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NotificationRuleUpdateOne) Mutation

Mutation returns the NotificationRuleMutation object of the builder.

func (*NotificationRuleUpdateOne) RemoveChannelIDs

func (nruo *NotificationRuleUpdateOne) RemoveChannelIDs(ids ...string) *NotificationRuleUpdateOne

RemoveChannelIDs removes the "channels" edge to NotificationChannel entities by IDs.

func (*NotificationRuleUpdateOne) RemoveChannels

RemoveChannels removes "channels" edges to NotificationChannel entities.

func (*NotificationRuleUpdateOne) RemoveEventIDs

func (nruo *NotificationRuleUpdateOne) RemoveEventIDs(ids ...string) *NotificationRuleUpdateOne

RemoveEventIDs removes the "events" edge to NotificationEvent entities by IDs.

func (*NotificationRuleUpdateOne) RemoveEvents

RemoveEvents removes "events" edges to NotificationEvent entities.

func (*NotificationRuleUpdateOne) Save

Save executes the query and returns the updated NotificationRule entity.

func (*NotificationRuleUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*NotificationRuleUpdateOne) Select

func (nruo *NotificationRuleUpdateOne) Select(field string, fields ...string) *NotificationRuleUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*NotificationRuleUpdateOne) SetConfig

SetConfig sets the "config" field.

func (*NotificationRuleUpdateOne) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*NotificationRuleUpdateOne) SetDisabled

SetDisabled sets the "disabled" field.

func (*NotificationRuleUpdateOne) SetName

SetName sets the "name" field.

func (*NotificationRuleUpdateOne) SetNillableConfig

SetNillableConfig sets the "config" field if the given value is not nil.

func (*NotificationRuleUpdateOne) SetNillableDeletedAt

func (nruo *NotificationRuleUpdateOne) SetNillableDeletedAt(t *time.Time) *NotificationRuleUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*NotificationRuleUpdateOne) SetNillableDisabled

func (nruo *NotificationRuleUpdateOne) SetNillableDisabled(b *bool) *NotificationRuleUpdateOne

SetNillableDisabled sets the "disabled" field if the given value is not nil.

func (*NotificationRuleUpdateOne) SetNillableName

func (nruo *NotificationRuleUpdateOne) SetNillableName(s *string) *NotificationRuleUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*NotificationRuleUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*NotificationRuleUpdateOne) Where

Where appends a list predicates to the NotificationRuleUpdate builder.

type NotificationRuleUpsert

type NotificationRuleUpsert struct {
	*sql.UpdateSet
}

NotificationRuleUpsert is the "OnConflict" setter.

func (*NotificationRuleUpsert) ClearDeletedAt

func (u *NotificationRuleUpsert) ClearDeletedAt() *NotificationRuleUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*NotificationRuleUpsert) ClearDisabled

func (u *NotificationRuleUpsert) ClearDisabled() *NotificationRuleUpsert

ClearDisabled clears the value of the "disabled" field.

func (*NotificationRuleUpsert) SetConfig

SetConfig sets the "config" field.

func (*NotificationRuleUpsert) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*NotificationRuleUpsert) SetDisabled

SetDisabled sets the "disabled" field.

func (*NotificationRuleUpsert) SetName

SetName sets the "name" field.

func (*NotificationRuleUpsert) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*NotificationRuleUpsert) UpdateConfig

UpdateConfig sets the "config" field to the value that was provided on create.

func (*NotificationRuleUpsert) UpdateDeletedAt

func (u *NotificationRuleUpsert) UpdateDeletedAt() *NotificationRuleUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*NotificationRuleUpsert) UpdateDisabled

func (u *NotificationRuleUpsert) UpdateDisabled() *NotificationRuleUpsert

UpdateDisabled sets the "disabled" field to the value that was provided on create.

func (*NotificationRuleUpsert) UpdateName

UpdateName sets the "name" field to the value that was provided on create.

func (*NotificationRuleUpsert) UpdateUpdatedAt

func (u *NotificationRuleUpsert) UpdateUpdatedAt() *NotificationRuleUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type NotificationRuleUpsertBulk

type NotificationRuleUpsertBulk struct {
	// contains filtered or unexported fields
}

NotificationRuleUpsertBulk is the builder for "upsert"-ing a bulk of NotificationRule nodes.

func (*NotificationRuleUpsertBulk) ClearDeletedAt

ClearDeletedAt clears the value of the "deleted_at" field.

func (*NotificationRuleUpsertBulk) ClearDisabled

ClearDisabled clears the value of the "disabled" field.

func (*NotificationRuleUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*NotificationRuleUpsertBulk) Exec

Exec executes the query.

func (*NotificationRuleUpsertBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*NotificationRuleUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.NotificationRule.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*NotificationRuleUpsertBulk) SetConfig

SetConfig sets the "config" field.

func (*NotificationRuleUpsertBulk) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*NotificationRuleUpsertBulk) SetDisabled

SetDisabled sets the "disabled" field.

func (*NotificationRuleUpsertBulk) SetName

SetName sets the "name" field.

func (*NotificationRuleUpsertBulk) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*NotificationRuleUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the NotificationRuleCreateBulk.OnConflict documentation for more info.

func (*NotificationRuleUpsertBulk) UpdateConfig

UpdateConfig sets the "config" field to the value that was provided on create.

func (*NotificationRuleUpsertBulk) UpdateDeletedAt

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*NotificationRuleUpsertBulk) UpdateDisabled

UpdateDisabled sets the "disabled" field to the value that was provided on create.

func (*NotificationRuleUpsertBulk) UpdateName

UpdateName sets the "name" field to the value that was provided on create.

func (*NotificationRuleUpsertBulk) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.NotificationRule.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(notificationrule.FieldID)
		}),
	).
	Exec(ctx)

func (*NotificationRuleUpsertBulk) UpdateUpdatedAt

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type NotificationRuleUpsertOne

type NotificationRuleUpsertOne struct {
	// contains filtered or unexported fields
}

NotificationRuleUpsertOne is the builder for "upsert"-ing

one NotificationRule node.

func (*NotificationRuleUpsertOne) ClearDeletedAt

ClearDeletedAt clears the value of the "deleted_at" field.

func (*NotificationRuleUpsertOne) ClearDisabled

ClearDisabled clears the value of the "disabled" field.

func (*NotificationRuleUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*NotificationRuleUpsertOne) Exec

Exec executes the query.

func (*NotificationRuleUpsertOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*NotificationRuleUpsertOne) ID

func (u *NotificationRuleUpsertOne) ID(ctx context.Context) (id string, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*NotificationRuleUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*NotificationRuleUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.NotificationRule.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*NotificationRuleUpsertOne) SetConfig

SetConfig sets the "config" field.

func (*NotificationRuleUpsertOne) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*NotificationRuleUpsertOne) SetDisabled

SetDisabled sets the "disabled" field.

func (*NotificationRuleUpsertOne) SetName

SetName sets the "name" field.

func (*NotificationRuleUpsertOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*NotificationRuleUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the NotificationRuleCreate.OnConflict documentation for more info.

func (*NotificationRuleUpsertOne) UpdateConfig

UpdateConfig sets the "config" field to the value that was provided on create.

func (*NotificationRuleUpsertOne) UpdateDeletedAt

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*NotificationRuleUpsertOne) UpdateDisabled

UpdateDisabled sets the "disabled" field to the value that was provided on create.

func (*NotificationRuleUpsertOne) UpdateName

UpdateName sets the "name" field to the value that was provided on create.

func (*NotificationRuleUpsertOne) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.NotificationRule.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(notificationrule.FieldID)
		}),
	).
	Exec(ctx)

func (*NotificationRuleUpsertOne) UpdateUpdatedAt

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type NotificationRules

type NotificationRules []*NotificationRule

NotificationRules is a parsable slice of NotificationRule.

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 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 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 {

	// BalanceSnapshot is the client for interacting with the BalanceSnapshot builders.
	BalanceSnapshot *BalanceSnapshotClient
	// Entitlement is the client for interacting with the Entitlement builders.
	Entitlement *EntitlementClient
	// Feature is the client for interacting with the Feature builders.
	Feature *FeatureClient
	// Grant is the client for interacting with the Grant builders.
	Grant *GrantClient
	// NotificationChannel is the client for interacting with the NotificationChannel builders.
	NotificationChannel *NotificationChannelClient
	// NotificationEvent is the client for interacting with the NotificationEvent builders.
	NotificationEvent *NotificationEventClient
	// NotificationEventDeliveryStatus is the client for interacting with the NotificationEventDeliveryStatus builders.
	NotificationEventDeliveryStatus *NotificationEventDeliveryStatusClient
	// NotificationRule is the client for interacting with the NotificationRule builders.
	NotificationRule *NotificationRuleClient
	// UsageReset is the client for interacting with the UsageReset builders.
	UsageReset *UsageResetClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func NewTxClientFromRawConfig

func NewTxClientFromRawConfig(ctx context.Context, cfg entutils.RawEntConfig) *Tx

NewTxClientFromConfig creates a new transactional client from a (hijacked) configuration.

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 UsageReset

type UsageReset struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// Namespace holds the value of the "namespace" field.
	Namespace string `json:"namespace,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"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// EntitlementID holds the value of the "entitlement_id" field.
	EntitlementID string `json:"entitlement_id,omitempty"`
	// ResetTime holds the value of the "reset_time" field.
	ResetTime time.Time `json:"reset_time,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UsageResetQuery when eager-loading is set.
	Edges UsageResetEdges `json:"edges"`
	// contains filtered or unexported fields
}

UsageReset is the model entity for the UsageReset schema.

func (*UsageReset) QueryEntitlement

func (ur *UsageReset) QueryEntitlement() *EntitlementQuery

QueryEntitlement queries the "entitlement" edge of the UsageReset entity.

func (*UsageReset) String

func (ur *UsageReset) String() string

String implements the fmt.Stringer.

func (*UsageReset) Unwrap

func (ur *UsageReset) Unwrap() *UsageReset

Unwrap unwraps the UsageReset 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 (*UsageReset) Update

func (ur *UsageReset) Update() *UsageResetUpdateOne

Update returns a builder for updating this UsageReset. Note that you need to call UsageReset.Unwrap() before calling this method if this UsageReset was returned from a transaction, and the transaction was committed or rolled back.

func (*UsageReset) Value

func (ur *UsageReset) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the UsageReset. This includes values selected through modifiers, order, etc.

type UsageResetClient

type UsageResetClient struct {
	// contains filtered or unexported fields
}

UsageResetClient is a client for the UsageReset schema.

func NewUsageResetClient

func NewUsageResetClient(c config) *UsageResetClient

NewUsageResetClient returns a client for the UsageReset from the given config.

func (*UsageResetClient) Create

func (c *UsageResetClient) Create() *UsageResetCreate

Create returns a builder for creating a UsageReset entity.

func (*UsageResetClient) CreateBulk

func (c *UsageResetClient) CreateBulk(builders ...*UsageResetCreate) *UsageResetCreateBulk

CreateBulk returns a builder for creating a bulk of UsageReset entities.

func (*UsageResetClient) Delete

func (c *UsageResetClient) Delete() *UsageResetDelete

Delete returns a delete builder for UsageReset.

func (*UsageResetClient) DeleteOne

func (c *UsageResetClient) DeleteOne(ur *UsageReset) *UsageResetDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UsageResetClient) DeleteOneID

func (c *UsageResetClient) DeleteOneID(id string) *UsageResetDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UsageResetClient) Get

func (c *UsageResetClient) Get(ctx context.Context, id string) (*UsageReset, error)

Get returns a UsageReset entity by its id.

func (*UsageResetClient) GetX

func (c *UsageResetClient) GetX(ctx context.Context, id string) *UsageReset

GetX is like Get, but panics if an error occurs.

func (*UsageResetClient) Hooks

func (c *UsageResetClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UsageResetClient) Intercept

func (c *UsageResetClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `usagereset.Intercept(f(g(h())))`.

func (*UsageResetClient) Interceptors

func (c *UsageResetClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UsageResetClient) MapCreateBulk

func (c *UsageResetClient) MapCreateBulk(slice any, setFunc func(*UsageResetCreate, int)) *UsageResetCreateBulk

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 (*UsageResetClient) Query

func (c *UsageResetClient) Query() *UsageResetQuery

Query returns a query builder for UsageReset.

func (*UsageResetClient) QueryEntitlement

func (c *UsageResetClient) QueryEntitlement(ur *UsageReset) *EntitlementQuery

QueryEntitlement queries the entitlement edge of a UsageReset.

func (*UsageResetClient) Update

func (c *UsageResetClient) Update() *UsageResetUpdate

Update returns an update builder for UsageReset.

func (*UsageResetClient) UpdateOne

func (c *UsageResetClient) UpdateOne(ur *UsageReset) *UsageResetUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UsageResetClient) UpdateOneID

func (c *UsageResetClient) UpdateOneID(id string) *UsageResetUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UsageResetClient) Use

func (c *UsageResetClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `usagereset.Hooks(f(g(h())))`.

type UsageResetCreate

type UsageResetCreate struct {
	// contains filtered or unexported fields
}

UsageResetCreate is the builder for creating a UsageReset entity.

func (*UsageResetCreate) Exec

func (urc *UsageResetCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UsageResetCreate) ExecX

func (urc *UsageResetCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UsageResetCreate) Mutation

func (urc *UsageResetCreate) Mutation() *UsageResetMutation

Mutation returns the UsageResetMutation object of the builder.

func (*UsageResetCreate) OnConflict

func (urc *UsageResetCreate) OnConflict(opts ...sql.ConflictOption) *UsageResetUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.UsageReset.Create().
	SetNamespace(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UsageResetUpsert) {
		SetNamespace(v+v).
	}).
	Exec(ctx)

func (*UsageResetCreate) OnConflictColumns

func (urc *UsageResetCreate) OnConflictColumns(columns ...string) *UsageResetUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.UsageReset.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UsageResetCreate) Save

func (urc *UsageResetCreate) Save(ctx context.Context) (*UsageReset, error)

Save creates the UsageReset in the database.

func (*UsageResetCreate) SaveX

func (urc *UsageResetCreate) SaveX(ctx context.Context) *UsageReset

SaveX calls Save and panics if Save returns an error.

func (*UsageResetCreate) SetCreatedAt

func (urc *UsageResetCreate) SetCreatedAt(t time.Time) *UsageResetCreate

SetCreatedAt sets the "created_at" field.

func (*UsageResetCreate) SetDeletedAt

func (urc *UsageResetCreate) SetDeletedAt(t time.Time) *UsageResetCreate

SetDeletedAt sets the "deleted_at" field.

func (*UsageResetCreate) SetEntitlement

func (urc *UsageResetCreate) SetEntitlement(e *Entitlement) *UsageResetCreate

SetEntitlement sets the "entitlement" edge to the Entitlement entity.

func (*UsageResetCreate) SetEntitlementID

func (urc *UsageResetCreate) SetEntitlementID(s string) *UsageResetCreate

SetEntitlementID sets the "entitlement_id" field.

func (*UsageResetCreate) SetID

func (urc *UsageResetCreate) SetID(s string) *UsageResetCreate

SetID sets the "id" field.

func (*UsageResetCreate) SetNamespace

func (urc *UsageResetCreate) SetNamespace(s string) *UsageResetCreate

SetNamespace sets the "namespace" field.

func (*UsageResetCreate) SetNillableCreatedAt

func (urc *UsageResetCreate) SetNillableCreatedAt(t *time.Time) *UsageResetCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UsageResetCreate) SetNillableDeletedAt

func (urc *UsageResetCreate) SetNillableDeletedAt(t *time.Time) *UsageResetCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*UsageResetCreate) SetNillableID

func (urc *UsageResetCreate) SetNillableID(s *string) *UsageResetCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*UsageResetCreate) SetNillableUpdatedAt

func (urc *UsageResetCreate) SetNillableUpdatedAt(t *time.Time) *UsageResetCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*UsageResetCreate) SetResetTime

func (urc *UsageResetCreate) SetResetTime(t time.Time) *UsageResetCreate

SetResetTime sets the "reset_time" field.

func (*UsageResetCreate) SetUpdatedAt

func (urc *UsageResetCreate) SetUpdatedAt(t time.Time) *UsageResetCreate

SetUpdatedAt sets the "updated_at" field.

type UsageResetCreateBulk

type UsageResetCreateBulk struct {
	// contains filtered or unexported fields
}

UsageResetCreateBulk is the builder for creating many UsageReset entities in bulk.

func (*UsageResetCreateBulk) Exec

func (urcb *UsageResetCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UsageResetCreateBulk) ExecX

func (urcb *UsageResetCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UsageResetCreateBulk) OnConflict

func (urcb *UsageResetCreateBulk) OnConflict(opts ...sql.ConflictOption) *UsageResetUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.UsageReset.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UsageResetUpsert) {
		SetNamespace(v+v).
	}).
	Exec(ctx)

func (*UsageResetCreateBulk) OnConflictColumns

func (urcb *UsageResetCreateBulk) OnConflictColumns(columns ...string) *UsageResetUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.UsageReset.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UsageResetCreateBulk) Save

func (urcb *UsageResetCreateBulk) Save(ctx context.Context) ([]*UsageReset, error)

Save creates the UsageReset entities in the database.

func (*UsageResetCreateBulk) SaveX

func (urcb *UsageResetCreateBulk) SaveX(ctx context.Context) []*UsageReset

SaveX is like Save, but panics if an error occurs.

type UsageResetDelete

type UsageResetDelete struct {
	// contains filtered or unexported fields
}

UsageResetDelete is the builder for deleting a UsageReset entity.

func (*UsageResetDelete) Exec

func (urd *UsageResetDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UsageResetDelete) ExecX

func (urd *UsageResetDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UsageResetDelete) Where

Where appends a list predicates to the UsageResetDelete builder.

type UsageResetDeleteOne

type UsageResetDeleteOne struct {
	// contains filtered or unexported fields
}

UsageResetDeleteOne is the builder for deleting a single UsageReset entity.

func (*UsageResetDeleteOne) Exec

func (urdo *UsageResetDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UsageResetDeleteOne) ExecX

func (urdo *UsageResetDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UsageResetDeleteOne) Where

Where appends a list predicates to the UsageResetDelete builder.

type UsageResetEdges

type UsageResetEdges struct {
	// Entitlement holds the value of the entitlement edge.
	Entitlement *Entitlement `json:"entitlement,omitempty"`
	// contains filtered or unexported fields
}

UsageResetEdges holds the relations/edges for other nodes in the graph.

func (UsageResetEdges) EntitlementOrErr

func (e UsageResetEdges) EntitlementOrErr() (*Entitlement, error)

EntitlementOrErr returns the Entitlement value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type UsageResetGroupBy

type UsageResetGroupBy struct {
	// contains filtered or unexported fields
}

UsageResetGroupBy is the group-by builder for UsageReset entities.

func (*UsageResetGroupBy) Aggregate

func (urgb *UsageResetGroupBy) Aggregate(fns ...AggregateFunc) *UsageResetGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UsageResetGroupBy) Bool

func (s *UsageResetGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UsageResetGroupBy) BoolX

func (s *UsageResetGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UsageResetGroupBy) Bools

func (s *UsageResetGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UsageResetGroupBy) BoolsX

func (s *UsageResetGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UsageResetGroupBy) Float64

func (s *UsageResetGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UsageResetGroupBy) Float64X

func (s *UsageResetGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UsageResetGroupBy) Float64s

func (s *UsageResetGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UsageResetGroupBy) Float64sX

func (s *UsageResetGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UsageResetGroupBy) Int

func (s *UsageResetGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UsageResetGroupBy) IntX

func (s *UsageResetGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UsageResetGroupBy) Ints

func (s *UsageResetGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UsageResetGroupBy) IntsX

func (s *UsageResetGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UsageResetGroupBy) Scan

func (urgb *UsageResetGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UsageResetGroupBy) ScanX

func (s *UsageResetGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UsageResetGroupBy) String

func (s *UsageResetGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UsageResetGroupBy) StringX

func (s *UsageResetGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UsageResetGroupBy) Strings

func (s *UsageResetGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UsageResetGroupBy) StringsX

func (s *UsageResetGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UsageResetMutation

type UsageResetMutation struct {
	// contains filtered or unexported fields
}

UsageResetMutation represents an operation that mutates the UsageReset nodes in the graph.

func (*UsageResetMutation) AddField

func (m *UsageResetMutation) 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 (*UsageResetMutation) AddedEdges

func (m *UsageResetMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UsageResetMutation) AddedField

func (m *UsageResetMutation) 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 (*UsageResetMutation) AddedFields

func (m *UsageResetMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UsageResetMutation) AddedIDs

func (m *UsageResetMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UsageResetMutation) ClearDeletedAt

func (m *UsageResetMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UsageResetMutation) ClearEdge

func (m *UsageResetMutation) 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 (*UsageResetMutation) ClearEntitlement

func (m *UsageResetMutation) ClearEntitlement()

ClearEntitlement clears the "entitlement" edge to the Entitlement entity.

func (*UsageResetMutation) ClearField

func (m *UsageResetMutation) 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 (*UsageResetMutation) ClearedEdges

func (m *UsageResetMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UsageResetMutation) ClearedFields

func (m *UsageResetMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UsageResetMutation) Client

func (m UsageResetMutation) 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 (*UsageResetMutation) CreatedAt

func (m *UsageResetMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*UsageResetMutation) DeletedAt

func (m *UsageResetMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*UsageResetMutation) DeletedAtCleared

func (m *UsageResetMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*UsageResetMutation) EdgeCleared

func (m *UsageResetMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UsageResetMutation) EntitlementCleared

func (m *UsageResetMutation) EntitlementCleared() bool

EntitlementCleared reports if the "entitlement" edge to the Entitlement entity was cleared.

func (*UsageResetMutation) EntitlementID

func (m *UsageResetMutation) EntitlementID() (r string, exists bool)

EntitlementID returns the value of the "entitlement_id" field in the mutation.

func (*UsageResetMutation) EntitlementIDs

func (m *UsageResetMutation) EntitlementIDs() (ids []string)

EntitlementIDs returns the "entitlement" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use EntitlementID instead. It exists only for internal usage by the builders.

func (*UsageResetMutation) Field

func (m *UsageResetMutation) 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 (*UsageResetMutation) FieldCleared

func (m *UsageResetMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UsageResetMutation) Fields

func (m *UsageResetMutation) 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 (*UsageResetMutation) ID

func (m *UsageResetMutation) ID() (id string, 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 (*UsageResetMutation) IDs

func (m *UsageResetMutation) IDs(ctx context.Context) ([]string, 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 (*UsageResetMutation) Namespace

func (m *UsageResetMutation) Namespace() (r string, exists bool)

Namespace returns the value of the "namespace" field in the mutation.

func (*UsageResetMutation) OldCreatedAt

func (m *UsageResetMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the UsageReset entity. If the UsageReset 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 (*UsageResetMutation) OldDeletedAt

func (m *UsageResetMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the UsageReset entity. If the UsageReset 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 (*UsageResetMutation) OldEntitlementID

func (m *UsageResetMutation) OldEntitlementID(ctx context.Context) (v string, err error)

OldEntitlementID returns the old "entitlement_id" field's value of the UsageReset entity. If the UsageReset 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 (*UsageResetMutation) OldField

func (m *UsageResetMutation) 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 (*UsageResetMutation) OldNamespace

func (m *UsageResetMutation) OldNamespace(ctx context.Context) (v string, err error)

OldNamespace returns the old "namespace" field's value of the UsageReset entity. If the UsageReset 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 (*UsageResetMutation) OldResetTime

func (m *UsageResetMutation) OldResetTime(ctx context.Context) (v time.Time, err error)

OldResetTime returns the old "reset_time" field's value of the UsageReset entity. If the UsageReset 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 (*UsageResetMutation) OldUpdatedAt

func (m *UsageResetMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the UsageReset entity. If the UsageReset 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 (*UsageResetMutation) Op

func (m *UsageResetMutation) Op() Op

Op returns the operation name.

func (*UsageResetMutation) RemovedEdges

func (m *UsageResetMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UsageResetMutation) RemovedIDs

func (m *UsageResetMutation) 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 (*UsageResetMutation) ResetCreatedAt

func (m *UsageResetMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UsageResetMutation) ResetDeletedAt

func (m *UsageResetMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*UsageResetMutation) ResetEdge

func (m *UsageResetMutation) 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 (*UsageResetMutation) ResetEntitlement

func (m *UsageResetMutation) ResetEntitlement()

ResetEntitlement resets all changes to the "entitlement" edge.

func (*UsageResetMutation) ResetEntitlementID

func (m *UsageResetMutation) ResetEntitlementID()

ResetEntitlementID resets all changes to the "entitlement_id" field.

func (*UsageResetMutation) ResetField

func (m *UsageResetMutation) 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 (*UsageResetMutation) ResetNamespace

func (m *UsageResetMutation) ResetNamespace()

ResetNamespace resets all changes to the "namespace" field.

func (*UsageResetMutation) ResetResetTime

func (m *UsageResetMutation) ResetResetTime()

ResetResetTime resets all changes to the "reset_time" field.

func (*UsageResetMutation) ResetTime

func (m *UsageResetMutation) ResetTime() (r time.Time, exists bool)

ResetTime returns the value of the "reset_time" field in the mutation.

func (*UsageResetMutation) ResetUpdatedAt

func (m *UsageResetMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UsageResetMutation) SetCreatedAt

func (m *UsageResetMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*UsageResetMutation) SetDeletedAt

func (m *UsageResetMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*UsageResetMutation) SetEntitlementID

func (m *UsageResetMutation) SetEntitlementID(s string)

SetEntitlementID sets the "entitlement_id" field.

func (*UsageResetMutation) SetField

func (m *UsageResetMutation) 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 (*UsageResetMutation) SetID

func (m *UsageResetMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of UsageReset entities.

func (*UsageResetMutation) SetNamespace

func (m *UsageResetMutation) SetNamespace(s string)

SetNamespace sets the "namespace" field.

func (*UsageResetMutation) SetOp

func (m *UsageResetMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UsageResetMutation) SetResetTime

func (m *UsageResetMutation) SetResetTime(t time.Time)

SetResetTime sets the "reset_time" field.

func (*UsageResetMutation) SetUpdatedAt

func (m *UsageResetMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (UsageResetMutation) Tx

func (m UsageResetMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UsageResetMutation) Type

func (m *UsageResetMutation) Type() string

Type returns the node type of this mutation (UsageReset).

func (*UsageResetMutation) UpdatedAt

func (m *UsageResetMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*UsageResetMutation) Where

func (m *UsageResetMutation) Where(ps ...predicate.UsageReset)

Where appends a list predicates to the UsageResetMutation builder.

func (*UsageResetMutation) WhereP

func (m *UsageResetMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UsageResetMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UsageResetQuery

type UsageResetQuery struct {
	// contains filtered or unexported fields
}

UsageResetQuery is the builder for querying UsageReset entities.

func (*UsageResetQuery) Aggregate

func (urq *UsageResetQuery) Aggregate(fns ...AggregateFunc) *UsageResetSelect

Aggregate returns a UsageResetSelect configured with the given aggregations.

func (*UsageResetQuery) All

func (urq *UsageResetQuery) All(ctx context.Context) ([]*UsageReset, error)

All executes the query and returns a list of UsageResets.

func (*UsageResetQuery) AllX

func (urq *UsageResetQuery) AllX(ctx context.Context) []*UsageReset

AllX is like All, but panics if an error occurs.

func (*UsageResetQuery) Clone

func (urq *UsageResetQuery) Clone() *UsageResetQuery

Clone returns a duplicate of the UsageResetQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UsageResetQuery) Count

func (urq *UsageResetQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UsageResetQuery) CountX

func (urq *UsageResetQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UsageResetQuery) Exist

func (urq *UsageResetQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UsageResetQuery) ExistX

func (urq *UsageResetQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UsageResetQuery) First

func (urq *UsageResetQuery) First(ctx context.Context) (*UsageReset, error)

First returns the first UsageReset entity from the query. Returns a *NotFoundError when no UsageReset was found.

func (*UsageResetQuery) FirstID

func (urq *UsageResetQuery) FirstID(ctx context.Context) (id string, err error)

FirstID returns the first UsageReset ID from the query. Returns a *NotFoundError when no UsageReset ID was found.

func (*UsageResetQuery) FirstIDX

func (urq *UsageResetQuery) FirstIDX(ctx context.Context) string

FirstIDX is like FirstID, but panics if an error occurs.

func (*UsageResetQuery) FirstX

func (urq *UsageResetQuery) FirstX(ctx context.Context) *UsageReset

FirstX is like First, but panics if an error occurs.

func (*UsageResetQuery) ForShare

func (urq *UsageResetQuery) ForShare(opts ...sql.LockOption) *UsageResetQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*UsageResetQuery) ForUpdate

func (urq *UsageResetQuery) ForUpdate(opts ...sql.LockOption) *UsageResetQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*UsageResetQuery) GroupBy

func (urq *UsageResetQuery) GroupBy(field string, fields ...string) *UsageResetGroupBy

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 {
	Namespace string `json:"namespace,omitempty"`
	Count int `json:"count,omitempty"`
}

client.UsageReset.Query().
	GroupBy(usagereset.FieldNamespace).
	Aggregate(db.Count()).
	Scan(ctx, &v)

func (*UsageResetQuery) IDs

func (urq *UsageResetQuery) IDs(ctx context.Context) (ids []string, err error)

IDs executes the query and returns a list of UsageReset IDs.

func (*UsageResetQuery) IDsX

func (urq *UsageResetQuery) IDsX(ctx context.Context) []string

IDsX is like IDs, but panics if an error occurs.

func (*UsageResetQuery) Limit

func (urq *UsageResetQuery) Limit(limit int) *UsageResetQuery

Limit the number of records to be returned by this query.

func (*UsageResetQuery) Offset

func (urq *UsageResetQuery) Offset(offset int) *UsageResetQuery

Offset to start from.

func (*UsageResetQuery) Only

func (urq *UsageResetQuery) Only(ctx context.Context) (*UsageReset, error)

Only returns a single UsageReset entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one UsageReset entity is found. Returns a *NotFoundError when no UsageReset entities are found.

func (*UsageResetQuery) OnlyID

func (urq *UsageResetQuery) OnlyID(ctx context.Context) (id string, err error)

OnlyID is like Only, but returns the only UsageReset ID in the query. Returns a *NotSingularError when more than one UsageReset ID is found. Returns a *NotFoundError when no entities are found.

func (*UsageResetQuery) OnlyIDX

func (urq *UsageResetQuery) OnlyIDX(ctx context.Context) string

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UsageResetQuery) OnlyX

func (urq *UsageResetQuery) OnlyX(ctx context.Context) *UsageReset

OnlyX is like Only, but panics if an error occurs.

func (*UsageResetQuery) Order

Order specifies how the records should be ordered.

func (*UsageResetQuery) Paginate

Paginate runs the query and returns a paginated response. If page is its 0 value then it will return all the items and populate the response page accordingly.

func (*UsageResetQuery) QueryEntitlement

func (urq *UsageResetQuery) QueryEntitlement() *EntitlementQuery

QueryEntitlement chains the current query on the "entitlement" edge.

func (*UsageResetQuery) Select

func (urq *UsageResetQuery) Select(fields ...string) *UsageResetSelect

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 {
	Namespace string `json:"namespace,omitempty"`
}

client.UsageReset.Query().
	Select(usagereset.FieldNamespace).
	Scan(ctx, &v)

func (*UsageResetQuery) Unique

func (urq *UsageResetQuery) Unique(unique bool) *UsageResetQuery

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 (*UsageResetQuery) Where

Where adds a new predicate for the UsageResetQuery builder.

func (*UsageResetQuery) WithEntitlement

func (urq *UsageResetQuery) WithEntitlement(opts ...func(*EntitlementQuery)) *UsageResetQuery

WithEntitlement tells the query-builder to eager-load the nodes that are connected to the "entitlement" edge. The optional arguments are used to configure the query builder of the edge.

type UsageResetSelect

type UsageResetSelect struct {
	*UsageResetQuery
	// contains filtered or unexported fields
}

UsageResetSelect is the builder for selecting fields of UsageReset entities.

func (*UsageResetSelect) Aggregate

func (urs *UsageResetSelect) Aggregate(fns ...AggregateFunc) *UsageResetSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UsageResetSelect) Bool

func (s *UsageResetSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UsageResetSelect) BoolX

func (s *UsageResetSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UsageResetSelect) Bools

func (s *UsageResetSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UsageResetSelect) BoolsX

func (s *UsageResetSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UsageResetSelect) Float64

func (s *UsageResetSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UsageResetSelect) Float64X

func (s *UsageResetSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UsageResetSelect) Float64s

func (s *UsageResetSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UsageResetSelect) Float64sX

func (s *UsageResetSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UsageResetSelect) Int

func (s *UsageResetSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UsageResetSelect) IntX

func (s *UsageResetSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UsageResetSelect) Ints

func (s *UsageResetSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UsageResetSelect) IntsX

func (s *UsageResetSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UsageResetSelect) Scan

func (urs *UsageResetSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UsageResetSelect) ScanX

func (s *UsageResetSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UsageResetSelect) String

func (s *UsageResetSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UsageResetSelect) StringX

func (s *UsageResetSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UsageResetSelect) Strings

func (s *UsageResetSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UsageResetSelect) StringsX

func (s *UsageResetSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UsageResetUpdate

type UsageResetUpdate struct {
	// contains filtered or unexported fields
}

UsageResetUpdate is the builder for updating UsageReset entities.

func (*UsageResetUpdate) ClearDeletedAt

func (uru *UsageResetUpdate) ClearDeletedAt() *UsageResetUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UsageResetUpdate) Exec

func (uru *UsageResetUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UsageResetUpdate) ExecX

func (uru *UsageResetUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UsageResetUpdate) Mutation

func (uru *UsageResetUpdate) Mutation() *UsageResetMutation

Mutation returns the UsageResetMutation object of the builder.

func (*UsageResetUpdate) Save

func (uru *UsageResetUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UsageResetUpdate) SaveX

func (uru *UsageResetUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UsageResetUpdate) SetDeletedAt

func (uru *UsageResetUpdate) SetDeletedAt(t time.Time) *UsageResetUpdate

SetDeletedAt sets the "deleted_at" field.

func (*UsageResetUpdate) SetNillableDeletedAt

func (uru *UsageResetUpdate) SetNillableDeletedAt(t *time.Time) *UsageResetUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*UsageResetUpdate) SetUpdatedAt

func (uru *UsageResetUpdate) SetUpdatedAt(t time.Time) *UsageResetUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UsageResetUpdate) Where

Where appends a list predicates to the UsageResetUpdate builder.

type UsageResetUpdateOne

type UsageResetUpdateOne struct {
	// contains filtered or unexported fields
}

UsageResetUpdateOne is the builder for updating a single UsageReset entity.

func (*UsageResetUpdateOne) ClearDeletedAt

func (uruo *UsageResetUpdateOne) ClearDeletedAt() *UsageResetUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UsageResetUpdateOne) Exec

func (uruo *UsageResetUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UsageResetUpdateOne) ExecX

func (uruo *UsageResetUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UsageResetUpdateOne) Mutation

func (uruo *UsageResetUpdateOne) Mutation() *UsageResetMutation

Mutation returns the UsageResetMutation object of the builder.

func (*UsageResetUpdateOne) Save

func (uruo *UsageResetUpdateOne) Save(ctx context.Context) (*UsageReset, error)

Save executes the query and returns the updated UsageReset entity.

func (*UsageResetUpdateOne) SaveX

func (uruo *UsageResetUpdateOne) SaveX(ctx context.Context) *UsageReset

SaveX is like Save, but panics if an error occurs.

func (*UsageResetUpdateOne) Select

func (uruo *UsageResetUpdateOne) Select(field string, fields ...string) *UsageResetUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UsageResetUpdateOne) SetDeletedAt

func (uruo *UsageResetUpdateOne) SetDeletedAt(t time.Time) *UsageResetUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*UsageResetUpdateOne) SetNillableDeletedAt

func (uruo *UsageResetUpdateOne) SetNillableDeletedAt(t *time.Time) *UsageResetUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*UsageResetUpdateOne) SetUpdatedAt

func (uruo *UsageResetUpdateOne) SetUpdatedAt(t time.Time) *UsageResetUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UsageResetUpdateOne) Where

Where appends a list predicates to the UsageResetUpdate builder.

type UsageResetUpsert

type UsageResetUpsert struct {
	*sql.UpdateSet
}

UsageResetUpsert is the "OnConflict" setter.

func (*UsageResetUpsert) ClearDeletedAt

func (u *UsageResetUpsert) ClearDeletedAt() *UsageResetUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UsageResetUpsert) SetDeletedAt

func (u *UsageResetUpsert) SetDeletedAt(v time.Time) *UsageResetUpsert

SetDeletedAt sets the "deleted_at" field.

func (*UsageResetUpsert) SetUpdatedAt

func (u *UsageResetUpsert) SetUpdatedAt(v time.Time) *UsageResetUpsert

SetUpdatedAt sets the "updated_at" field.

func (*UsageResetUpsert) UpdateDeletedAt

func (u *UsageResetUpsert) UpdateDeletedAt() *UsageResetUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*UsageResetUpsert) UpdateUpdatedAt

func (u *UsageResetUpsert) UpdateUpdatedAt() *UsageResetUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type UsageResetUpsertBulk

type UsageResetUpsertBulk struct {
	// contains filtered or unexported fields
}

UsageResetUpsertBulk is the builder for "upsert"-ing a bulk of UsageReset nodes.

func (*UsageResetUpsertBulk) ClearDeletedAt

func (u *UsageResetUpsertBulk) ClearDeletedAt() *UsageResetUpsertBulk

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UsageResetUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UsageResetUpsertBulk) Exec

Exec executes the query.

func (*UsageResetUpsertBulk) ExecX

func (u *UsageResetUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UsageResetUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.UsageReset.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*UsageResetUpsertBulk) SetDeletedAt

func (u *UsageResetUpsertBulk) SetDeletedAt(v time.Time) *UsageResetUpsertBulk

SetDeletedAt sets the "deleted_at" field.

func (*UsageResetUpsertBulk) SetUpdatedAt

func (u *UsageResetUpsertBulk) SetUpdatedAt(v time.Time) *UsageResetUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*UsageResetUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the UsageResetCreateBulk.OnConflict documentation for more info.

func (*UsageResetUpsertBulk) UpdateDeletedAt

func (u *UsageResetUpsertBulk) UpdateDeletedAt() *UsageResetUpsertBulk

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*UsageResetUpsertBulk) UpdateNewValues

func (u *UsageResetUpsertBulk) UpdateNewValues() *UsageResetUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.UsageReset.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(usagereset.FieldID)
		}),
	).
	Exec(ctx)

func (*UsageResetUpsertBulk) UpdateUpdatedAt

func (u *UsageResetUpsertBulk) UpdateUpdatedAt() *UsageResetUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type UsageResetUpsertOne

type UsageResetUpsertOne struct {
	// contains filtered or unexported fields
}

UsageResetUpsertOne is the builder for "upsert"-ing

one UsageReset node.

func (*UsageResetUpsertOne) ClearDeletedAt

func (u *UsageResetUpsertOne) ClearDeletedAt() *UsageResetUpsertOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UsageResetUpsertOne) DoNothing

func (u *UsageResetUpsertOne) DoNothing() *UsageResetUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UsageResetUpsertOne) Exec

Exec executes the query.

func (*UsageResetUpsertOne) ExecX

func (u *UsageResetUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UsageResetUpsertOne) ID

func (u *UsageResetUpsertOne) ID(ctx context.Context) (id string, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*UsageResetUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*UsageResetUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.UsageReset.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*UsageResetUpsertOne) SetDeletedAt

func (u *UsageResetUpsertOne) SetDeletedAt(v time.Time) *UsageResetUpsertOne

SetDeletedAt sets the "deleted_at" field.

func (*UsageResetUpsertOne) SetUpdatedAt

func (u *UsageResetUpsertOne) SetUpdatedAt(v time.Time) *UsageResetUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*UsageResetUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the UsageResetCreate.OnConflict documentation for more info.

func (*UsageResetUpsertOne) UpdateDeletedAt

func (u *UsageResetUpsertOne) UpdateDeletedAt() *UsageResetUpsertOne

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*UsageResetUpsertOne) UpdateNewValues

func (u *UsageResetUpsertOne) UpdateNewValues() *UsageResetUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.UsageReset.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(usagereset.FieldID)
		}),
	).
	Exec(ctx)

func (*UsageResetUpsertOne) UpdateUpdatedAt

func (u *UsageResetUpsertOne) UpdateUpdatedAt() *UsageResetUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type UsageResets

type UsageResets []*UsageReset

UsageResets is a parsable slice of UsageReset.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL