Documentation
¶
Index ¶
- Constants
- Variables
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) GetConfig() *entutils.RawEntConfig
- func (c *Client) HijackTx(ctx context.Context, opts *sql.TxOptions) (context.Context, *entutils.RawEntConfig, *ExposedTxDriver, error)
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Entitlement
- type EntitlementClient
- func (c *EntitlementClient) Create() *EntitlementCreate
- func (c *EntitlementClient) CreateBulk(builders ...*EntitlementCreate) *EntitlementCreateBulk
- func (c *EntitlementClient) Delete() *EntitlementDelete
- func (c *EntitlementClient) DeleteOne(e *Entitlement) *EntitlementDeleteOne
- func (c *EntitlementClient) DeleteOneID(id string) *EntitlementDeleteOne
- func (c *EntitlementClient) Get(ctx context.Context, id string) (*Entitlement, error)
- func (c *EntitlementClient) GetX(ctx context.Context, id string) *Entitlement
- func (c *EntitlementClient) Hooks() []Hook
- func (c *EntitlementClient) Intercept(interceptors ...Interceptor)
- func (c *EntitlementClient) Interceptors() []Interceptor
- func (c *EntitlementClient) MapCreateBulk(slice any, setFunc func(*EntitlementCreate, int)) *EntitlementCreateBulk
- func (c *EntitlementClient) Query() *EntitlementQuery
- func (c *EntitlementClient) QueryUsageReset(e *Entitlement) *UsageResetQuery
- func (c *EntitlementClient) Update() *EntitlementUpdate
- func (c *EntitlementClient) UpdateOne(e *Entitlement) *EntitlementUpdateOne
- func (c *EntitlementClient) UpdateOneID(id string) *EntitlementUpdateOne
- func (c *EntitlementClient) Use(hooks ...Hook)
- type EntitlementCreate
- func (ec *EntitlementCreate) AddUsageReset(u ...*UsageReset) *EntitlementCreate
- func (ec *EntitlementCreate) AddUsageResetIDs(ids ...string) *EntitlementCreate
- func (ec *EntitlementCreate) Exec(ctx context.Context) error
- func (ec *EntitlementCreate) ExecX(ctx context.Context)
- func (ec *EntitlementCreate) Mutation() *EntitlementMutation
- func (ec *EntitlementCreate) OnConflict(opts ...sql.ConflictOption) *EntitlementUpsertOne
- func (ec *EntitlementCreate) OnConflictColumns(columns ...string) *EntitlementUpsertOne
- func (ec *EntitlementCreate) Save(ctx context.Context) (*Entitlement, error)
- func (ec *EntitlementCreate) SaveX(ctx context.Context) *Entitlement
- func (ec *EntitlementCreate) SetConfig(u []uint8) *EntitlementCreate
- func (ec *EntitlementCreate) SetCreatedAt(t time.Time) *EntitlementCreate
- func (ec *EntitlementCreate) SetCurrentUsagePeriodEnd(t time.Time) *EntitlementCreate
- func (ec *EntitlementCreate) SetCurrentUsagePeriodStart(t time.Time) *EntitlementCreate
- func (ec *EntitlementCreate) SetDeletedAt(t time.Time) *EntitlementCreate
- func (ec *EntitlementCreate) SetEntitlementType(et entitlement.EntitlementType) *EntitlementCreate
- func (ec *EntitlementCreate) SetFeatureID(s string) *EntitlementCreate
- func (ec *EntitlementCreate) SetFeatureKey(s string) *EntitlementCreate
- func (ec *EntitlementCreate) SetID(s string) *EntitlementCreate
- func (ec *EntitlementCreate) SetIsSoftLimit(b bool) *EntitlementCreate
- func (ec *EntitlementCreate) SetIssueAfterReset(f float64) *EntitlementCreate
- func (ec *EntitlementCreate) SetIssueAfterResetPriority(u uint8) *EntitlementCreate
- func (ec *EntitlementCreate) SetMeasureUsageFrom(t time.Time) *EntitlementCreate
- func (ec *EntitlementCreate) SetMetadata(m map[string]string) *EntitlementCreate
- func (ec *EntitlementCreate) SetNamespace(s string) *EntitlementCreate
- func (ec *EntitlementCreate) SetNillableCreatedAt(t *time.Time) *EntitlementCreate
- func (ec *EntitlementCreate) SetNillableCurrentUsagePeriodEnd(t *time.Time) *EntitlementCreate
- func (ec *EntitlementCreate) SetNillableCurrentUsagePeriodStart(t *time.Time) *EntitlementCreate
- func (ec *EntitlementCreate) SetNillableDeletedAt(t *time.Time) *EntitlementCreate
- func (ec *EntitlementCreate) SetNillableID(s *string) *EntitlementCreate
- func (ec *EntitlementCreate) SetNillableIsSoftLimit(b *bool) *EntitlementCreate
- func (ec *EntitlementCreate) SetNillableIssueAfterReset(f *float64) *EntitlementCreate
- func (ec *EntitlementCreate) SetNillableIssueAfterResetPriority(u *uint8) *EntitlementCreate
- func (ec *EntitlementCreate) SetNillableMeasureUsageFrom(t *time.Time) *EntitlementCreate
- func (ec *EntitlementCreate) SetNillableUpdatedAt(t *time.Time) *EntitlementCreate
- func (ec *EntitlementCreate) SetNillableUsagePeriodAnchor(t *time.Time) *EntitlementCreate
- func (ec *EntitlementCreate) SetNillableUsagePeriodInterval(epi *entitlement.UsagePeriodInterval) *EntitlementCreate
- func (ec *EntitlementCreate) SetSubjectKey(s string) *EntitlementCreate
- func (ec *EntitlementCreate) SetUpdatedAt(t time.Time) *EntitlementCreate
- func (ec *EntitlementCreate) SetUsagePeriodAnchor(t time.Time) *EntitlementCreate
- func (ec *EntitlementCreate) SetUsagePeriodInterval(epi entitlement.UsagePeriodInterval) *EntitlementCreate
- type EntitlementCreateBulk
- func (ecb *EntitlementCreateBulk) Exec(ctx context.Context) error
- func (ecb *EntitlementCreateBulk) ExecX(ctx context.Context)
- func (ecb *EntitlementCreateBulk) OnConflict(opts ...sql.ConflictOption) *EntitlementUpsertBulk
- func (ecb *EntitlementCreateBulk) OnConflictColumns(columns ...string) *EntitlementUpsertBulk
- func (ecb *EntitlementCreateBulk) Save(ctx context.Context) ([]*Entitlement, error)
- func (ecb *EntitlementCreateBulk) SaveX(ctx context.Context) []*Entitlement
- type EntitlementDelete
- type EntitlementDeleteOne
- type EntitlementEdges
- type EntitlementGroupBy
- func (egb *EntitlementGroupBy) Aggregate(fns ...AggregateFunc) *EntitlementGroupBy
- func (s *EntitlementGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *EntitlementGroupBy) BoolX(ctx context.Context) bool
- func (s *EntitlementGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *EntitlementGroupBy) BoolsX(ctx context.Context) []bool
- func (s *EntitlementGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *EntitlementGroupBy) Float64X(ctx context.Context) float64
- func (s *EntitlementGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *EntitlementGroupBy) Float64sX(ctx context.Context) []float64
- func (s *EntitlementGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *EntitlementGroupBy) IntX(ctx context.Context) int
- func (s *EntitlementGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *EntitlementGroupBy) IntsX(ctx context.Context) []int
- func (egb *EntitlementGroupBy) Scan(ctx context.Context, v any) error
- func (s *EntitlementGroupBy) ScanX(ctx context.Context, v any)
- func (s *EntitlementGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *EntitlementGroupBy) StringX(ctx context.Context) string
- func (s *EntitlementGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *EntitlementGroupBy) StringsX(ctx context.Context) []string
- type EntitlementMutation
- func (m *EntitlementMutation) AddField(name string, value ent.Value) error
- func (m *EntitlementMutation) AddIssueAfterReset(f float64)
- func (m *EntitlementMutation) AddIssueAfterResetPriority(u int8)
- func (m *EntitlementMutation) AddUsageResetIDs(ids ...string)
- func (m *EntitlementMutation) AddedEdges() []string
- func (m *EntitlementMutation) AddedField(name string) (ent.Value, bool)
- func (m *EntitlementMutation) AddedFields() []string
- func (m *EntitlementMutation) AddedIDs(name string) []ent.Value
- func (m *EntitlementMutation) AddedIssueAfterReset() (r float64, exists bool)
- func (m *EntitlementMutation) AddedIssueAfterResetPriority() (r int8, exists bool)
- func (m *EntitlementMutation) AppendConfig(u []uint8)
- func (m *EntitlementMutation) AppendedConfig() ([]uint8, bool)
- func (m *EntitlementMutation) ClearConfig()
- func (m *EntitlementMutation) ClearCurrentUsagePeriodEnd()
- func (m *EntitlementMutation) ClearCurrentUsagePeriodStart()
- func (m *EntitlementMutation) ClearDeletedAt()
- func (m *EntitlementMutation) ClearEdge(name string) error
- func (m *EntitlementMutation) ClearField(name string) error
- func (m *EntitlementMutation) ClearIsSoftLimit()
- func (m *EntitlementMutation) ClearIssueAfterReset()
- func (m *EntitlementMutation) ClearIssueAfterResetPriority()
- func (m *EntitlementMutation) ClearMeasureUsageFrom()
- func (m *EntitlementMutation) ClearMetadata()
- func (m *EntitlementMutation) ClearUsagePeriodAnchor()
- func (m *EntitlementMutation) ClearUsagePeriodInterval()
- func (m *EntitlementMutation) ClearUsageReset()
- func (m *EntitlementMutation) ClearedEdges() []string
- func (m *EntitlementMutation) ClearedFields() []string
- func (m EntitlementMutation) Client() *Client
- func (m *EntitlementMutation) Config() (r []uint8, exists bool)
- func (m *EntitlementMutation) ConfigCleared() bool
- func (m *EntitlementMutation) CreatedAt() (r time.Time, exists bool)
- func (m *EntitlementMutation) CurrentUsagePeriodEnd() (r time.Time, exists bool)
- func (m *EntitlementMutation) CurrentUsagePeriodEndCleared() bool
- func (m *EntitlementMutation) CurrentUsagePeriodStart() (r time.Time, exists bool)
- func (m *EntitlementMutation) CurrentUsagePeriodStartCleared() bool
- func (m *EntitlementMutation) DeletedAt() (r time.Time, exists bool)
- func (m *EntitlementMutation) DeletedAtCleared() bool
- func (m *EntitlementMutation) EdgeCleared(name string) bool
- func (m *EntitlementMutation) EntitlementType() (r entitlement.EntitlementType, exists bool)
- func (m *EntitlementMutation) FeatureID() (r string, exists bool)
- func (m *EntitlementMutation) FeatureKey() (r string, exists bool)
- func (m *EntitlementMutation) Field(name string) (ent.Value, bool)
- func (m *EntitlementMutation) FieldCleared(name string) bool
- func (m *EntitlementMutation) Fields() []string
- func (m *EntitlementMutation) ID() (id string, exists bool)
- func (m *EntitlementMutation) IDs(ctx context.Context) ([]string, error)
- func (m *EntitlementMutation) IsSoftLimit() (r bool, exists bool)
- func (m *EntitlementMutation) IsSoftLimitCleared() bool
- func (m *EntitlementMutation) IssueAfterReset() (r float64, exists bool)
- func (m *EntitlementMutation) IssueAfterResetCleared() bool
- func (m *EntitlementMutation) IssueAfterResetPriority() (r uint8, exists bool)
- func (m *EntitlementMutation) IssueAfterResetPriorityCleared() bool
- func (m *EntitlementMutation) MeasureUsageFrom() (r time.Time, exists bool)
- func (m *EntitlementMutation) MeasureUsageFromCleared() bool
- func (m *EntitlementMutation) Metadata() (r map[string]string, exists bool)
- func (m *EntitlementMutation) MetadataCleared() bool
- func (m *EntitlementMutation) Namespace() (r string, exists bool)
- func (m *EntitlementMutation) OldConfig(ctx context.Context) (v []uint8, err error)
- func (m *EntitlementMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *EntitlementMutation) OldCurrentUsagePeriodEnd(ctx context.Context) (v *time.Time, err error)
- func (m *EntitlementMutation) OldCurrentUsagePeriodStart(ctx context.Context) (v *time.Time, err error)
- func (m *EntitlementMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)
- func (m *EntitlementMutation) OldEntitlementType(ctx context.Context) (v entitlement.EntitlementType, err error)
- func (m *EntitlementMutation) OldFeatureID(ctx context.Context) (v string, err error)
- func (m *EntitlementMutation) OldFeatureKey(ctx context.Context) (v string, err error)
- func (m *EntitlementMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *EntitlementMutation) OldIsSoftLimit(ctx context.Context) (v *bool, err error)
- func (m *EntitlementMutation) OldIssueAfterReset(ctx context.Context) (v *float64, err error)
- func (m *EntitlementMutation) OldIssueAfterResetPriority(ctx context.Context) (v *uint8, err error)
- func (m *EntitlementMutation) OldMeasureUsageFrom(ctx context.Context) (v *time.Time, err error)
- func (m *EntitlementMutation) OldMetadata(ctx context.Context) (v map[string]string, err error)
- func (m *EntitlementMutation) OldNamespace(ctx context.Context) (v string, err error)
- func (m *EntitlementMutation) OldSubjectKey(ctx context.Context) (v string, err error)
- func (m *EntitlementMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *EntitlementMutation) OldUsagePeriodAnchor(ctx context.Context) (v *time.Time, err error)
- func (m *EntitlementMutation) OldUsagePeriodInterval(ctx context.Context) (v *entitlement.UsagePeriodInterval, err error)
- func (m *EntitlementMutation) Op() Op
- func (m *EntitlementMutation) RemoveUsageResetIDs(ids ...string)
- func (m *EntitlementMutation) RemovedEdges() []string
- func (m *EntitlementMutation) RemovedIDs(name string) []ent.Value
- func (m *EntitlementMutation) RemovedUsageResetIDs() (ids []string)
- func (m *EntitlementMutation) ResetConfig()
- func (m *EntitlementMutation) ResetCreatedAt()
- func (m *EntitlementMutation) ResetCurrentUsagePeriodEnd()
- func (m *EntitlementMutation) ResetCurrentUsagePeriodStart()
- func (m *EntitlementMutation) ResetDeletedAt()
- func (m *EntitlementMutation) ResetEdge(name string) error
- func (m *EntitlementMutation) ResetEntitlementType()
- func (m *EntitlementMutation) ResetFeatureID()
- func (m *EntitlementMutation) ResetFeatureKey()
- func (m *EntitlementMutation) ResetField(name string) error
- func (m *EntitlementMutation) ResetIsSoftLimit()
- func (m *EntitlementMutation) ResetIssueAfterReset()
- func (m *EntitlementMutation) ResetIssueAfterResetPriority()
- func (m *EntitlementMutation) ResetMeasureUsageFrom()
- func (m *EntitlementMutation) ResetMetadata()
- func (m *EntitlementMutation) ResetNamespace()
- func (m *EntitlementMutation) ResetSubjectKey()
- func (m *EntitlementMutation) ResetUpdatedAt()
- func (m *EntitlementMutation) ResetUsagePeriodAnchor()
- func (m *EntitlementMutation) ResetUsagePeriodInterval()
- func (m *EntitlementMutation) ResetUsageReset()
- func (m *EntitlementMutation) SetConfig(u []uint8)
- func (m *EntitlementMutation) SetCreatedAt(t time.Time)
- func (m *EntitlementMutation) SetCurrentUsagePeriodEnd(t time.Time)
- func (m *EntitlementMutation) SetCurrentUsagePeriodStart(t time.Time)
- func (m *EntitlementMutation) SetDeletedAt(t time.Time)
- func (m *EntitlementMutation) SetEntitlementType(et entitlement.EntitlementType)
- func (m *EntitlementMutation) SetFeatureID(s string)
- func (m *EntitlementMutation) SetFeatureKey(s string)
- func (m *EntitlementMutation) SetField(name string, value ent.Value) error
- func (m *EntitlementMutation) SetID(id string)
- func (m *EntitlementMutation) SetIsSoftLimit(b bool)
- func (m *EntitlementMutation) SetIssueAfterReset(f float64)
- func (m *EntitlementMutation) SetIssueAfterResetPriority(u uint8)
- func (m *EntitlementMutation) SetMeasureUsageFrom(t time.Time)
- func (m *EntitlementMutation) SetMetadata(value map[string]string)
- func (m *EntitlementMutation) SetNamespace(s string)
- func (m *EntitlementMutation) SetOp(op Op)
- func (m *EntitlementMutation) SetSubjectKey(s string)
- func (m *EntitlementMutation) SetUpdatedAt(t time.Time)
- func (m *EntitlementMutation) SetUsagePeriodAnchor(t time.Time)
- func (m *EntitlementMutation) SetUsagePeriodInterval(epi entitlement.UsagePeriodInterval)
- func (m *EntitlementMutation) SubjectKey() (r string, exists bool)
- func (m EntitlementMutation) Tx() (*Tx, error)
- func (m *EntitlementMutation) Type() string
- func (m *EntitlementMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *EntitlementMutation) UsagePeriodAnchor() (r time.Time, exists bool)
- func (m *EntitlementMutation) UsagePeriodAnchorCleared() bool
- func (m *EntitlementMutation) UsagePeriodInterval() (r entitlement.UsagePeriodInterval, exists bool)
- func (m *EntitlementMutation) UsagePeriodIntervalCleared() bool
- func (m *EntitlementMutation) UsageResetCleared() bool
- func (m *EntitlementMutation) UsageResetIDs() (ids []string)
- func (m *EntitlementMutation) Where(ps ...predicate.Entitlement)
- func (m *EntitlementMutation) WhereP(ps ...func(*sql.Selector))
- type EntitlementQuery
- func (eq *EntitlementQuery) Aggregate(fns ...AggregateFunc) *EntitlementSelect
- func (eq *EntitlementQuery) All(ctx context.Context) ([]*Entitlement, error)
- func (eq *EntitlementQuery) AllX(ctx context.Context) []*Entitlement
- func (eq *EntitlementQuery) Clone() *EntitlementQuery
- func (eq *EntitlementQuery) Count(ctx context.Context) (int, error)
- func (eq *EntitlementQuery) CountX(ctx context.Context) int
- func (eq *EntitlementQuery) Exist(ctx context.Context) (bool, error)
- func (eq *EntitlementQuery) ExistX(ctx context.Context) bool
- func (eq *EntitlementQuery) First(ctx context.Context) (*Entitlement, error)
- func (eq *EntitlementQuery) FirstID(ctx context.Context) (id string, err error)
- func (eq *EntitlementQuery) FirstIDX(ctx context.Context) string
- func (eq *EntitlementQuery) FirstX(ctx context.Context) *Entitlement
- func (eq *EntitlementQuery) ForShare(opts ...sql.LockOption) *EntitlementQuery
- func (eq *EntitlementQuery) ForUpdate(opts ...sql.LockOption) *EntitlementQuery
- func (eq *EntitlementQuery) GroupBy(field string, fields ...string) *EntitlementGroupBy
- func (eq *EntitlementQuery) IDs(ctx context.Context) (ids []string, err error)
- func (eq *EntitlementQuery) IDsX(ctx context.Context) []string
- func (eq *EntitlementQuery) Limit(limit int) *EntitlementQuery
- func (eq *EntitlementQuery) Offset(offset int) *EntitlementQuery
- func (eq *EntitlementQuery) Only(ctx context.Context) (*Entitlement, error)
- func (eq *EntitlementQuery) OnlyID(ctx context.Context) (id string, err error)
- func (eq *EntitlementQuery) OnlyIDX(ctx context.Context) string
- func (eq *EntitlementQuery) OnlyX(ctx context.Context) *Entitlement
- func (eq *EntitlementQuery) Order(o ...entitlement.OrderOption) *EntitlementQuery
- func (eq *EntitlementQuery) QueryUsageReset() *UsageResetQuery
- func (eq *EntitlementQuery) Select(fields ...string) *EntitlementSelect
- func (eq *EntitlementQuery) Unique(unique bool) *EntitlementQuery
- func (eq *EntitlementQuery) Where(ps ...predicate.Entitlement) *EntitlementQuery
- func (eq *EntitlementQuery) WithUsageReset(opts ...func(*UsageResetQuery)) *EntitlementQuery
- type EntitlementSelect
- func (es *EntitlementSelect) Aggregate(fns ...AggregateFunc) *EntitlementSelect
- func (s *EntitlementSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *EntitlementSelect) BoolX(ctx context.Context) bool
- func (s *EntitlementSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *EntitlementSelect) BoolsX(ctx context.Context) []bool
- func (s *EntitlementSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *EntitlementSelect) Float64X(ctx context.Context) float64
- func (s *EntitlementSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *EntitlementSelect) Float64sX(ctx context.Context) []float64
- func (s *EntitlementSelect) Int(ctx context.Context) (_ int, err error)
- func (s *EntitlementSelect) IntX(ctx context.Context) int
- func (s *EntitlementSelect) Ints(ctx context.Context) ([]int, error)
- func (s *EntitlementSelect) IntsX(ctx context.Context) []int
- func (es *EntitlementSelect) Scan(ctx context.Context, v any) error
- func (s *EntitlementSelect) ScanX(ctx context.Context, v any)
- func (s *EntitlementSelect) String(ctx context.Context) (_ string, err error)
- func (s *EntitlementSelect) StringX(ctx context.Context) string
- func (s *EntitlementSelect) Strings(ctx context.Context) ([]string, error)
- func (s *EntitlementSelect) StringsX(ctx context.Context) []string
- type EntitlementUpdate
- func (eu *EntitlementUpdate) AddUsageReset(u ...*UsageReset) *EntitlementUpdate
- func (eu *EntitlementUpdate) AddUsageResetIDs(ids ...string) *EntitlementUpdate
- func (eu *EntitlementUpdate) AppendConfig(u []uint8) *EntitlementUpdate
- func (eu *EntitlementUpdate) ClearConfig() *EntitlementUpdate
- func (eu *EntitlementUpdate) ClearCurrentUsagePeriodEnd() *EntitlementUpdate
- func (eu *EntitlementUpdate) ClearCurrentUsagePeriodStart() *EntitlementUpdate
- func (eu *EntitlementUpdate) ClearDeletedAt() *EntitlementUpdate
- func (eu *EntitlementUpdate) ClearMetadata() *EntitlementUpdate
- func (eu *EntitlementUpdate) ClearUsagePeriodAnchor() *EntitlementUpdate
- func (eu *EntitlementUpdate) ClearUsageReset() *EntitlementUpdate
- func (eu *EntitlementUpdate) Exec(ctx context.Context) error
- func (eu *EntitlementUpdate) ExecX(ctx context.Context)
- func (eu *EntitlementUpdate) Mutation() *EntitlementMutation
- func (eu *EntitlementUpdate) RemoveUsageReset(u ...*UsageReset) *EntitlementUpdate
- func (eu *EntitlementUpdate) RemoveUsageResetIDs(ids ...string) *EntitlementUpdate
- func (eu *EntitlementUpdate) Save(ctx context.Context) (int, error)
- func (eu *EntitlementUpdate) SaveX(ctx context.Context) int
- func (eu *EntitlementUpdate) SetConfig(u []uint8) *EntitlementUpdate
- func (eu *EntitlementUpdate) SetCurrentUsagePeriodEnd(t time.Time) *EntitlementUpdate
- func (eu *EntitlementUpdate) SetCurrentUsagePeriodStart(t time.Time) *EntitlementUpdate
- func (eu *EntitlementUpdate) SetDeletedAt(t time.Time) *EntitlementUpdate
- func (eu *EntitlementUpdate) SetMetadata(m map[string]string) *EntitlementUpdate
- func (eu *EntitlementUpdate) SetNillableCurrentUsagePeriodEnd(t *time.Time) *EntitlementUpdate
- func (eu *EntitlementUpdate) SetNillableCurrentUsagePeriodStart(t *time.Time) *EntitlementUpdate
- func (eu *EntitlementUpdate) SetNillableDeletedAt(t *time.Time) *EntitlementUpdate
- func (eu *EntitlementUpdate) SetNillableUsagePeriodAnchor(t *time.Time) *EntitlementUpdate
- func (eu *EntitlementUpdate) SetUpdatedAt(t time.Time) *EntitlementUpdate
- func (eu *EntitlementUpdate) SetUsagePeriodAnchor(t time.Time) *EntitlementUpdate
- func (eu *EntitlementUpdate) Where(ps ...predicate.Entitlement) *EntitlementUpdate
- type EntitlementUpdateOne
- func (euo *EntitlementUpdateOne) AddUsageReset(u ...*UsageReset) *EntitlementUpdateOne
- func (euo *EntitlementUpdateOne) AddUsageResetIDs(ids ...string) *EntitlementUpdateOne
- func (euo *EntitlementUpdateOne) AppendConfig(u []uint8) *EntitlementUpdateOne
- func (euo *EntitlementUpdateOne) ClearConfig() *EntitlementUpdateOne
- func (euo *EntitlementUpdateOne) ClearCurrentUsagePeriodEnd() *EntitlementUpdateOne
- func (euo *EntitlementUpdateOne) ClearCurrentUsagePeriodStart() *EntitlementUpdateOne
- func (euo *EntitlementUpdateOne) ClearDeletedAt() *EntitlementUpdateOne
- func (euo *EntitlementUpdateOne) ClearMetadata() *EntitlementUpdateOne
- func (euo *EntitlementUpdateOne) ClearUsagePeriodAnchor() *EntitlementUpdateOne
- func (euo *EntitlementUpdateOne) ClearUsageReset() *EntitlementUpdateOne
- func (euo *EntitlementUpdateOne) Exec(ctx context.Context) error
- func (euo *EntitlementUpdateOne) ExecX(ctx context.Context)
- func (euo *EntitlementUpdateOne) Mutation() *EntitlementMutation
- func (euo *EntitlementUpdateOne) RemoveUsageReset(u ...*UsageReset) *EntitlementUpdateOne
- func (euo *EntitlementUpdateOne) RemoveUsageResetIDs(ids ...string) *EntitlementUpdateOne
- func (euo *EntitlementUpdateOne) Save(ctx context.Context) (*Entitlement, error)
- func (euo *EntitlementUpdateOne) SaveX(ctx context.Context) *Entitlement
- func (euo *EntitlementUpdateOne) Select(field string, fields ...string) *EntitlementUpdateOne
- func (euo *EntitlementUpdateOne) SetConfig(u []uint8) *EntitlementUpdateOne
- func (euo *EntitlementUpdateOne) SetCurrentUsagePeriodEnd(t time.Time) *EntitlementUpdateOne
- func (euo *EntitlementUpdateOne) SetCurrentUsagePeriodStart(t time.Time) *EntitlementUpdateOne
- func (euo *EntitlementUpdateOne) SetDeletedAt(t time.Time) *EntitlementUpdateOne
- func (euo *EntitlementUpdateOne) SetMetadata(m map[string]string) *EntitlementUpdateOne
- func (euo *EntitlementUpdateOne) SetNillableCurrentUsagePeriodEnd(t *time.Time) *EntitlementUpdateOne
- func (euo *EntitlementUpdateOne) SetNillableCurrentUsagePeriodStart(t *time.Time) *EntitlementUpdateOne
- func (euo *EntitlementUpdateOne) SetNillableDeletedAt(t *time.Time) *EntitlementUpdateOne
- func (euo *EntitlementUpdateOne) SetNillableUsagePeriodAnchor(t *time.Time) *EntitlementUpdateOne
- func (euo *EntitlementUpdateOne) SetUpdatedAt(t time.Time) *EntitlementUpdateOne
- func (euo *EntitlementUpdateOne) SetUsagePeriodAnchor(t time.Time) *EntitlementUpdateOne
- func (euo *EntitlementUpdateOne) Where(ps ...predicate.Entitlement) *EntitlementUpdateOne
- type EntitlementUpsert
- func (u *EntitlementUpsert) ClearConfig() *EntitlementUpsert
- func (u *EntitlementUpsert) ClearCurrentUsagePeriodEnd() *EntitlementUpsert
- func (u *EntitlementUpsert) ClearCurrentUsagePeriodStart() *EntitlementUpsert
- func (u *EntitlementUpsert) ClearDeletedAt() *EntitlementUpsert
- func (u *EntitlementUpsert) ClearMetadata() *EntitlementUpsert
- func (u *EntitlementUpsert) ClearUsagePeriodAnchor() *EntitlementUpsert
- func (u *EntitlementUpsert) SetConfig(v []uint8) *EntitlementUpsert
- func (u *EntitlementUpsert) SetCurrentUsagePeriodEnd(v time.Time) *EntitlementUpsert
- func (u *EntitlementUpsert) SetCurrentUsagePeriodStart(v time.Time) *EntitlementUpsert
- func (u *EntitlementUpsert) SetDeletedAt(v time.Time) *EntitlementUpsert
- func (u *EntitlementUpsert) SetMetadata(v map[string]string) *EntitlementUpsert
- func (u *EntitlementUpsert) SetUpdatedAt(v time.Time) *EntitlementUpsert
- func (u *EntitlementUpsert) SetUsagePeriodAnchor(v time.Time) *EntitlementUpsert
- func (u *EntitlementUpsert) UpdateConfig() *EntitlementUpsert
- func (u *EntitlementUpsert) UpdateCurrentUsagePeriodEnd() *EntitlementUpsert
- func (u *EntitlementUpsert) UpdateCurrentUsagePeriodStart() *EntitlementUpsert
- func (u *EntitlementUpsert) UpdateDeletedAt() *EntitlementUpsert
- func (u *EntitlementUpsert) UpdateMetadata() *EntitlementUpsert
- func (u *EntitlementUpsert) UpdateUpdatedAt() *EntitlementUpsert
- func (u *EntitlementUpsert) UpdateUsagePeriodAnchor() *EntitlementUpsert
- type EntitlementUpsertBulk
- func (u *EntitlementUpsertBulk) ClearConfig() *EntitlementUpsertBulk
- func (u *EntitlementUpsertBulk) ClearCurrentUsagePeriodEnd() *EntitlementUpsertBulk
- func (u *EntitlementUpsertBulk) ClearCurrentUsagePeriodStart() *EntitlementUpsertBulk
- func (u *EntitlementUpsertBulk) ClearDeletedAt() *EntitlementUpsertBulk
- func (u *EntitlementUpsertBulk) ClearMetadata() *EntitlementUpsertBulk
- func (u *EntitlementUpsertBulk) ClearUsagePeriodAnchor() *EntitlementUpsertBulk
- func (u *EntitlementUpsertBulk) DoNothing() *EntitlementUpsertBulk
- func (u *EntitlementUpsertBulk) Exec(ctx context.Context) error
- func (u *EntitlementUpsertBulk) ExecX(ctx context.Context)
- func (u *EntitlementUpsertBulk) Ignore() *EntitlementUpsertBulk
- func (u *EntitlementUpsertBulk) SetConfig(v []uint8) *EntitlementUpsertBulk
- func (u *EntitlementUpsertBulk) SetCurrentUsagePeriodEnd(v time.Time) *EntitlementUpsertBulk
- func (u *EntitlementUpsertBulk) SetCurrentUsagePeriodStart(v time.Time) *EntitlementUpsertBulk
- func (u *EntitlementUpsertBulk) SetDeletedAt(v time.Time) *EntitlementUpsertBulk
- func (u *EntitlementUpsertBulk) SetMetadata(v map[string]string) *EntitlementUpsertBulk
- func (u *EntitlementUpsertBulk) SetUpdatedAt(v time.Time) *EntitlementUpsertBulk
- func (u *EntitlementUpsertBulk) SetUsagePeriodAnchor(v time.Time) *EntitlementUpsertBulk
- func (u *EntitlementUpsertBulk) Update(set func(*EntitlementUpsert)) *EntitlementUpsertBulk
- func (u *EntitlementUpsertBulk) UpdateConfig() *EntitlementUpsertBulk
- func (u *EntitlementUpsertBulk) UpdateCurrentUsagePeriodEnd() *EntitlementUpsertBulk
- func (u *EntitlementUpsertBulk) UpdateCurrentUsagePeriodStart() *EntitlementUpsertBulk
- func (u *EntitlementUpsertBulk) UpdateDeletedAt() *EntitlementUpsertBulk
- func (u *EntitlementUpsertBulk) UpdateMetadata() *EntitlementUpsertBulk
- func (u *EntitlementUpsertBulk) UpdateNewValues() *EntitlementUpsertBulk
- func (u *EntitlementUpsertBulk) UpdateUpdatedAt() *EntitlementUpsertBulk
- func (u *EntitlementUpsertBulk) UpdateUsagePeriodAnchor() *EntitlementUpsertBulk
- type EntitlementUpsertOne
- func (u *EntitlementUpsertOne) ClearConfig() *EntitlementUpsertOne
- func (u *EntitlementUpsertOne) ClearCurrentUsagePeriodEnd() *EntitlementUpsertOne
- func (u *EntitlementUpsertOne) ClearCurrentUsagePeriodStart() *EntitlementUpsertOne
- func (u *EntitlementUpsertOne) ClearDeletedAt() *EntitlementUpsertOne
- func (u *EntitlementUpsertOne) ClearMetadata() *EntitlementUpsertOne
- func (u *EntitlementUpsertOne) ClearUsagePeriodAnchor() *EntitlementUpsertOne
- func (u *EntitlementUpsertOne) DoNothing() *EntitlementUpsertOne
- func (u *EntitlementUpsertOne) Exec(ctx context.Context) error
- func (u *EntitlementUpsertOne) ExecX(ctx context.Context)
- func (u *EntitlementUpsertOne) ID(ctx context.Context) (id string, err error)
- func (u *EntitlementUpsertOne) IDX(ctx context.Context) string
- func (u *EntitlementUpsertOne) Ignore() *EntitlementUpsertOne
- func (u *EntitlementUpsertOne) SetConfig(v []uint8) *EntitlementUpsertOne
- func (u *EntitlementUpsertOne) SetCurrentUsagePeriodEnd(v time.Time) *EntitlementUpsertOne
- func (u *EntitlementUpsertOne) SetCurrentUsagePeriodStart(v time.Time) *EntitlementUpsertOne
- func (u *EntitlementUpsertOne) SetDeletedAt(v time.Time) *EntitlementUpsertOne
- func (u *EntitlementUpsertOne) SetMetadata(v map[string]string) *EntitlementUpsertOne
- func (u *EntitlementUpsertOne) SetUpdatedAt(v time.Time) *EntitlementUpsertOne
- func (u *EntitlementUpsertOne) SetUsagePeriodAnchor(v time.Time) *EntitlementUpsertOne
- func (u *EntitlementUpsertOne) Update(set func(*EntitlementUpsert)) *EntitlementUpsertOne
- func (u *EntitlementUpsertOne) UpdateConfig() *EntitlementUpsertOne
- func (u *EntitlementUpsertOne) UpdateCurrentUsagePeriodEnd() *EntitlementUpsertOne
- func (u *EntitlementUpsertOne) UpdateCurrentUsagePeriodStart() *EntitlementUpsertOne
- func (u *EntitlementUpsertOne) UpdateDeletedAt() *EntitlementUpsertOne
- func (u *EntitlementUpsertOne) UpdateMetadata() *EntitlementUpsertOne
- func (u *EntitlementUpsertOne) UpdateNewValues() *EntitlementUpsertOne
- func (u *EntitlementUpsertOne) UpdateUpdatedAt() *EntitlementUpsertOne
- func (u *EntitlementUpsertOne) UpdateUsagePeriodAnchor() *EntitlementUpsertOne
- type Entitlements
- type ExposedTxDriver
- type Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type TraverseFunc
- type Traverser
- type Tx
- type UsageReset
- type UsageResetClient
- func (c *UsageResetClient) Create() *UsageResetCreate
- func (c *UsageResetClient) CreateBulk(builders ...*UsageResetCreate) *UsageResetCreateBulk
- func (c *UsageResetClient) Delete() *UsageResetDelete
- func (c *UsageResetClient) DeleteOne(ur *UsageReset) *UsageResetDeleteOne
- func (c *UsageResetClient) DeleteOneID(id string) *UsageResetDeleteOne
- func (c *UsageResetClient) Get(ctx context.Context, id string) (*UsageReset, error)
- func (c *UsageResetClient) GetX(ctx context.Context, id string) *UsageReset
- func (c *UsageResetClient) Hooks() []Hook
- func (c *UsageResetClient) Intercept(interceptors ...Interceptor)
- func (c *UsageResetClient) Interceptors() []Interceptor
- func (c *UsageResetClient) MapCreateBulk(slice any, setFunc func(*UsageResetCreate, int)) *UsageResetCreateBulk
- func (c *UsageResetClient) Query() *UsageResetQuery
- func (c *UsageResetClient) QueryEntitlement(ur *UsageReset) *EntitlementQuery
- func (c *UsageResetClient) Update() *UsageResetUpdate
- func (c *UsageResetClient) UpdateOne(ur *UsageReset) *UsageResetUpdateOne
- func (c *UsageResetClient) UpdateOneID(id string) *UsageResetUpdateOne
- func (c *UsageResetClient) Use(hooks ...Hook)
- type UsageResetCreate
- func (urc *UsageResetCreate) Exec(ctx context.Context) error
- func (urc *UsageResetCreate) ExecX(ctx context.Context)
- func (urc *UsageResetCreate) Mutation() *UsageResetMutation
- func (urc *UsageResetCreate) OnConflict(opts ...sql.ConflictOption) *UsageResetUpsertOne
- func (urc *UsageResetCreate) OnConflictColumns(columns ...string) *UsageResetUpsertOne
- func (urc *UsageResetCreate) Save(ctx context.Context) (*UsageReset, error)
- func (urc *UsageResetCreate) SaveX(ctx context.Context) *UsageReset
- func (urc *UsageResetCreate) SetCreatedAt(t time.Time) *UsageResetCreate
- func (urc *UsageResetCreate) SetDeletedAt(t time.Time) *UsageResetCreate
- func (urc *UsageResetCreate) SetEntitlement(e *Entitlement) *UsageResetCreate
- func (urc *UsageResetCreate) SetEntitlementID(s string) *UsageResetCreate
- func (urc *UsageResetCreate) SetID(s string) *UsageResetCreate
- func (urc *UsageResetCreate) SetNamespace(s string) *UsageResetCreate
- func (urc *UsageResetCreate) SetNillableCreatedAt(t *time.Time) *UsageResetCreate
- func (urc *UsageResetCreate) SetNillableDeletedAt(t *time.Time) *UsageResetCreate
- func (urc *UsageResetCreate) SetNillableID(s *string) *UsageResetCreate
- func (urc *UsageResetCreate) SetNillableUpdatedAt(t *time.Time) *UsageResetCreate
- func (urc *UsageResetCreate) SetResetTime(t time.Time) *UsageResetCreate
- func (urc *UsageResetCreate) SetUpdatedAt(t time.Time) *UsageResetCreate
- type UsageResetCreateBulk
- func (urcb *UsageResetCreateBulk) Exec(ctx context.Context) error
- func (urcb *UsageResetCreateBulk) ExecX(ctx context.Context)
- func (urcb *UsageResetCreateBulk) OnConflict(opts ...sql.ConflictOption) *UsageResetUpsertBulk
- func (urcb *UsageResetCreateBulk) OnConflictColumns(columns ...string) *UsageResetUpsertBulk
- func (urcb *UsageResetCreateBulk) Save(ctx context.Context) ([]*UsageReset, error)
- func (urcb *UsageResetCreateBulk) SaveX(ctx context.Context) []*UsageReset
- type UsageResetDelete
- type UsageResetDeleteOne
- type UsageResetEdges
- type UsageResetGroupBy
- func (urgb *UsageResetGroupBy) Aggregate(fns ...AggregateFunc) *UsageResetGroupBy
- func (s *UsageResetGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UsageResetGroupBy) BoolX(ctx context.Context) bool
- func (s *UsageResetGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UsageResetGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UsageResetGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UsageResetGroupBy) Float64X(ctx context.Context) float64
- func (s *UsageResetGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UsageResetGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UsageResetGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UsageResetGroupBy) IntX(ctx context.Context) int
- func (s *UsageResetGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UsageResetGroupBy) IntsX(ctx context.Context) []int
- func (urgb *UsageResetGroupBy) Scan(ctx context.Context, v any) error
- func (s *UsageResetGroupBy) ScanX(ctx context.Context, v any)
- func (s *UsageResetGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UsageResetGroupBy) StringX(ctx context.Context) string
- func (s *UsageResetGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UsageResetGroupBy) StringsX(ctx context.Context) []string
- type UsageResetMutation
- func (m *UsageResetMutation) AddField(name string, value ent.Value) error
- func (m *UsageResetMutation) AddedEdges() []string
- func (m *UsageResetMutation) AddedField(name string) (ent.Value, bool)
- func (m *UsageResetMutation) AddedFields() []string
- func (m *UsageResetMutation) AddedIDs(name string) []ent.Value
- func (m *UsageResetMutation) ClearDeletedAt()
- func (m *UsageResetMutation) ClearEdge(name string) error
- func (m *UsageResetMutation) ClearEntitlement()
- func (m *UsageResetMutation) ClearField(name string) error
- func (m *UsageResetMutation) ClearedEdges() []string
- func (m *UsageResetMutation) ClearedFields() []string
- func (m UsageResetMutation) Client() *Client
- func (m *UsageResetMutation) CreatedAt() (r time.Time, exists bool)
- func (m *UsageResetMutation) DeletedAt() (r time.Time, exists bool)
- func (m *UsageResetMutation) DeletedAtCleared() bool
- func (m *UsageResetMutation) EdgeCleared(name string) bool
- func (m *UsageResetMutation) EntitlementCleared() bool
- func (m *UsageResetMutation) EntitlementID() (r string, exists bool)
- func (m *UsageResetMutation) EntitlementIDs() (ids []string)
- func (m *UsageResetMutation) Field(name string) (ent.Value, bool)
- func (m *UsageResetMutation) FieldCleared(name string) bool
- func (m *UsageResetMutation) Fields() []string
- func (m *UsageResetMutation) ID() (id string, exists bool)
- func (m *UsageResetMutation) IDs(ctx context.Context) ([]string, error)
- func (m *UsageResetMutation) Namespace() (r string, exists bool)
- func (m *UsageResetMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UsageResetMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)
- func (m *UsageResetMutation) OldEntitlementID(ctx context.Context) (v string, err error)
- func (m *UsageResetMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UsageResetMutation) OldNamespace(ctx context.Context) (v string, err error)
- func (m *UsageResetMutation) OldResetTime(ctx context.Context) (v time.Time, err error)
- func (m *UsageResetMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UsageResetMutation) Op() Op
- func (m *UsageResetMutation) RemovedEdges() []string
- func (m *UsageResetMutation) RemovedIDs(name string) []ent.Value
- func (m *UsageResetMutation) ResetCreatedAt()
- func (m *UsageResetMutation) ResetDeletedAt()
- func (m *UsageResetMutation) ResetEdge(name string) error
- func (m *UsageResetMutation) ResetEntitlement()
- func (m *UsageResetMutation) ResetEntitlementID()
- func (m *UsageResetMutation) ResetField(name string) error
- func (m *UsageResetMutation) ResetNamespace()
- func (m *UsageResetMutation) ResetResetTime()
- func (m *UsageResetMutation) ResetTime() (r time.Time, exists bool)
- func (m *UsageResetMutation) ResetUpdatedAt()
- func (m *UsageResetMutation) SetCreatedAt(t time.Time)
- func (m *UsageResetMutation) SetDeletedAt(t time.Time)
- func (m *UsageResetMutation) SetEntitlementID(s string)
- func (m *UsageResetMutation) SetField(name string, value ent.Value) error
- func (m *UsageResetMutation) SetID(id string)
- func (m *UsageResetMutation) SetNamespace(s string)
- func (m *UsageResetMutation) SetOp(op Op)
- func (m *UsageResetMutation) SetResetTime(t time.Time)
- func (m *UsageResetMutation) SetUpdatedAt(t time.Time)
- func (m UsageResetMutation) Tx() (*Tx, error)
- func (m *UsageResetMutation) Type() string
- func (m *UsageResetMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *UsageResetMutation) Where(ps ...predicate.UsageReset)
- func (m *UsageResetMutation) WhereP(ps ...func(*sql.Selector))
- type UsageResetQuery
- func (urq *UsageResetQuery) Aggregate(fns ...AggregateFunc) *UsageResetSelect
- func (urq *UsageResetQuery) All(ctx context.Context) ([]*UsageReset, error)
- func (urq *UsageResetQuery) AllX(ctx context.Context) []*UsageReset
- func (urq *UsageResetQuery) Clone() *UsageResetQuery
- func (urq *UsageResetQuery) Count(ctx context.Context) (int, error)
- func (urq *UsageResetQuery) CountX(ctx context.Context) int
- func (urq *UsageResetQuery) Exist(ctx context.Context) (bool, error)
- func (urq *UsageResetQuery) ExistX(ctx context.Context) bool
- func (urq *UsageResetQuery) First(ctx context.Context) (*UsageReset, error)
- func (urq *UsageResetQuery) FirstID(ctx context.Context) (id string, err error)
- func (urq *UsageResetQuery) FirstIDX(ctx context.Context) string
- func (urq *UsageResetQuery) FirstX(ctx context.Context) *UsageReset
- func (urq *UsageResetQuery) ForShare(opts ...sql.LockOption) *UsageResetQuery
- func (urq *UsageResetQuery) ForUpdate(opts ...sql.LockOption) *UsageResetQuery
- func (urq *UsageResetQuery) GroupBy(field string, fields ...string) *UsageResetGroupBy
- func (urq *UsageResetQuery) IDs(ctx context.Context) (ids []string, err error)
- func (urq *UsageResetQuery) IDsX(ctx context.Context) []string
- func (urq *UsageResetQuery) Limit(limit int) *UsageResetQuery
- func (urq *UsageResetQuery) Offset(offset int) *UsageResetQuery
- func (urq *UsageResetQuery) Only(ctx context.Context) (*UsageReset, error)
- func (urq *UsageResetQuery) OnlyID(ctx context.Context) (id string, err error)
- func (urq *UsageResetQuery) OnlyIDX(ctx context.Context) string
- func (urq *UsageResetQuery) OnlyX(ctx context.Context) *UsageReset
- func (urq *UsageResetQuery) Order(o ...usagereset.OrderOption) *UsageResetQuery
- func (urq *UsageResetQuery) QueryEntitlement() *EntitlementQuery
- func (urq *UsageResetQuery) Select(fields ...string) *UsageResetSelect
- func (urq *UsageResetQuery) Unique(unique bool) *UsageResetQuery
- func (urq *UsageResetQuery) Where(ps ...predicate.UsageReset) *UsageResetQuery
- func (urq *UsageResetQuery) WithEntitlement(opts ...func(*EntitlementQuery)) *UsageResetQuery
- type UsageResetSelect
- func (urs *UsageResetSelect) Aggregate(fns ...AggregateFunc) *UsageResetSelect
- func (s *UsageResetSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *UsageResetSelect) BoolX(ctx context.Context) bool
- func (s *UsageResetSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *UsageResetSelect) BoolsX(ctx context.Context) []bool
- func (s *UsageResetSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *UsageResetSelect) Float64X(ctx context.Context) float64
- func (s *UsageResetSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *UsageResetSelect) Float64sX(ctx context.Context) []float64
- func (s *UsageResetSelect) Int(ctx context.Context) (_ int, err error)
- func (s *UsageResetSelect) IntX(ctx context.Context) int
- func (s *UsageResetSelect) Ints(ctx context.Context) ([]int, error)
- func (s *UsageResetSelect) IntsX(ctx context.Context) []int
- func (urs *UsageResetSelect) Scan(ctx context.Context, v any) error
- func (s *UsageResetSelect) ScanX(ctx context.Context, v any)
- func (s *UsageResetSelect) String(ctx context.Context) (_ string, err error)
- func (s *UsageResetSelect) StringX(ctx context.Context) string
- func (s *UsageResetSelect) Strings(ctx context.Context) ([]string, error)
- func (s *UsageResetSelect) StringsX(ctx context.Context) []string
- type UsageResetUpdate
- func (uru *UsageResetUpdate) ClearDeletedAt() *UsageResetUpdate
- func (uru *UsageResetUpdate) Exec(ctx context.Context) error
- func (uru *UsageResetUpdate) ExecX(ctx context.Context)
- func (uru *UsageResetUpdate) Mutation() *UsageResetMutation
- func (uru *UsageResetUpdate) Save(ctx context.Context) (int, error)
- func (uru *UsageResetUpdate) SaveX(ctx context.Context) int
- func (uru *UsageResetUpdate) SetDeletedAt(t time.Time) *UsageResetUpdate
- func (uru *UsageResetUpdate) SetNillableDeletedAt(t *time.Time) *UsageResetUpdate
- func (uru *UsageResetUpdate) SetUpdatedAt(t time.Time) *UsageResetUpdate
- func (uru *UsageResetUpdate) Where(ps ...predicate.UsageReset) *UsageResetUpdate
- type UsageResetUpdateOne
- func (uruo *UsageResetUpdateOne) ClearDeletedAt() *UsageResetUpdateOne
- func (uruo *UsageResetUpdateOne) Exec(ctx context.Context) error
- func (uruo *UsageResetUpdateOne) ExecX(ctx context.Context)
- func (uruo *UsageResetUpdateOne) Mutation() *UsageResetMutation
- func (uruo *UsageResetUpdateOne) Save(ctx context.Context) (*UsageReset, error)
- func (uruo *UsageResetUpdateOne) SaveX(ctx context.Context) *UsageReset
- func (uruo *UsageResetUpdateOne) Select(field string, fields ...string) *UsageResetUpdateOne
- func (uruo *UsageResetUpdateOne) SetDeletedAt(t time.Time) *UsageResetUpdateOne
- func (uruo *UsageResetUpdateOne) SetNillableDeletedAt(t *time.Time) *UsageResetUpdateOne
- func (uruo *UsageResetUpdateOne) SetUpdatedAt(t time.Time) *UsageResetUpdateOne
- func (uruo *UsageResetUpdateOne) Where(ps ...predicate.UsageReset) *UsageResetUpdateOne
- type UsageResetUpsert
- func (u *UsageResetUpsert) ClearDeletedAt() *UsageResetUpsert
- func (u *UsageResetUpsert) SetDeletedAt(v time.Time) *UsageResetUpsert
- func (u *UsageResetUpsert) SetUpdatedAt(v time.Time) *UsageResetUpsert
- func (u *UsageResetUpsert) UpdateDeletedAt() *UsageResetUpsert
- func (u *UsageResetUpsert) UpdateUpdatedAt() *UsageResetUpsert
- type UsageResetUpsertBulk
- func (u *UsageResetUpsertBulk) ClearDeletedAt() *UsageResetUpsertBulk
- func (u *UsageResetUpsertBulk) DoNothing() *UsageResetUpsertBulk
- func (u *UsageResetUpsertBulk) Exec(ctx context.Context) error
- func (u *UsageResetUpsertBulk) ExecX(ctx context.Context)
- func (u *UsageResetUpsertBulk) Ignore() *UsageResetUpsertBulk
- func (u *UsageResetUpsertBulk) SetDeletedAt(v time.Time) *UsageResetUpsertBulk
- func (u *UsageResetUpsertBulk) SetUpdatedAt(v time.Time) *UsageResetUpsertBulk
- func (u *UsageResetUpsertBulk) Update(set func(*UsageResetUpsert)) *UsageResetUpsertBulk
- func (u *UsageResetUpsertBulk) UpdateDeletedAt() *UsageResetUpsertBulk
- func (u *UsageResetUpsertBulk) UpdateNewValues() *UsageResetUpsertBulk
- func (u *UsageResetUpsertBulk) UpdateUpdatedAt() *UsageResetUpsertBulk
- type UsageResetUpsertOne
- func (u *UsageResetUpsertOne) ClearDeletedAt() *UsageResetUpsertOne
- func (u *UsageResetUpsertOne) DoNothing() *UsageResetUpsertOne
- func (u *UsageResetUpsertOne) Exec(ctx context.Context) error
- func (u *UsageResetUpsertOne) ExecX(ctx context.Context)
- func (u *UsageResetUpsertOne) ID(ctx context.Context) (id string, err error)
- func (u *UsageResetUpsertOne) IDX(ctx context.Context) string
- func (u *UsageResetUpsertOne) Ignore() *UsageResetUpsertOne
- func (u *UsageResetUpsertOne) SetDeletedAt(v time.Time) *UsageResetUpsertOne
- func (u *UsageResetUpsertOne) SetUpdatedAt(v time.Time) *UsageResetUpsertOne
- func (u *UsageResetUpsertOne) Update(set func(*UsageResetUpsert)) *UsageResetUpsertOne
- func (u *UsageResetUpsertOne) UpdateDeletedAt() *UsageResetUpsertOne
- func (u *UsageResetUpsertOne) UpdateNewValues() *UsageResetUpsertOne
- func (u *UsageResetUpsertOne) UpdateUpdatedAt() *UsageResetUpsertOne
- type UsageResets
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeEntitlement = "Entitlement" TypeUsageReset = "UsageReset" )
Variables ¶
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 IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
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 Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Entitlement is the client for interacting with the Entitlement builders. Entitlement *EntitlementClient // 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 ¶
FromContext returns a Client stored inside a context, or nil if there isn't one.
func Open ¶
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) Debug ¶
Debug returns a new debug-client. It's used to get verbose logging on specific operations.
client.Debug(). Entitlement. Query(). Count(ctx)
func (*Client) GetConfig ¶
func (c *Client) GetConfig() *entutils.RawEntConfig
func (*Client) HijackTx ¶
func (c *Client) HijackTx(ctx context.Context, opts *sql.TxOptions) (context.Context, *entutils.RawEntConfig, *ExposedTxDriver, error)
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(...)`.
type CommitFunc ¶
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.
type CommitHook ¶
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 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"` // 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) 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.
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 ¶
func (c *EntitlementClient) DeleteOne(e *Entitlement) *EntitlementDeleteOne
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 ¶
func (c *EntitlementClient) Get(ctx context.Context, id string) (*Entitlement, error)
Get returns a Entitlement entity by its id.
func (*EntitlementClient) GetX ¶
func (c *EntitlementClient) GetX(ctx context.Context, id string) *Entitlement
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) 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 ¶
func (c *EntitlementClient) UpdateOne(e *Entitlement) *EntitlementUpdateOne
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) 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 ¶
func (ec *EntitlementCreate) Save(ctx context.Context) (*Entitlement, error)
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) 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 ¶
func (ec *EntitlementCreate) SetID(s string) *EntitlementCreate
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) 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) 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 ¶
func (ecb *EntitlementCreateBulk) OnConflict(opts ...sql.ConflictOption) *EntitlementUpsertBulk
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 ¶
func (ed *EntitlementDelete) Where(ps ...predicate.Entitlement) *EntitlementDelete
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 ¶
func (edo *EntitlementDeleteOne) Where(ps ...predicate.Entitlement) *EntitlementDeleteOne
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"` // contains filtered or unexported fields }
EntitlementEdges holds the relations/edges for other nodes in the graph.
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 ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*EntitlementGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*EntitlementGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*EntitlementGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*EntitlementGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*EntitlementGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
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) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type EntitlementMutation ¶
type EntitlementMutation struct {
// contains filtered or unexported fields
}
EntitlementMutation represents an operation that mutates the Entitlement nodes in the graph.
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) 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) 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) 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) 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) 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) FeatureID ¶
func (m *EntitlementMutation) FeatureID() (r string, exists bool)
FeatureID returns the value of the "feature_id" field in the mutation.
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) 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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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) 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 ¶
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 ¶
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) RemoveUsageResetIDs ¶
func (m *EntitlementMutation) RemoveUsageResetIDs(ids ...string)
RemoveUsageResetIDs removes the "usage_reset" edge to the UsageReset entity by IDs.
func (*EntitlementMutation) RemovedEdges ¶
func (m *EntitlementMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
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) 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) 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) 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) 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) 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 ¶
func (eq *EntitlementQuery) Order(o ...entitlement.OrderOption) *EntitlementQuery
Order specifies how the records should be ordered.
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 ¶
func (eq *EntitlementQuery) Where(ps ...predicate.Entitlement) *EntitlementQuery
Where adds a new predicate for the EntitlementQuery builder.
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 ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*EntitlementSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*EntitlementSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*EntitlementSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*EntitlementSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*EntitlementSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
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) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type EntitlementUpdate ¶
type EntitlementUpdate struct {
// contains filtered or unexported fields
}
EntitlementUpdate is the builder for updating Entitlement entities.
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) 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) 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) 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 ¶
func (eu *EntitlementUpdate) Where(ps ...predicate.Entitlement) *EntitlementUpdate
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) 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) 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) 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) 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 ¶
func (euo *EntitlementUpdateOne) Save(ctx context.Context) (*Entitlement, error)
Save executes the query and returns the updated Entitlement entity.
func (*EntitlementUpdateOne) SaveX ¶
func (euo *EntitlementUpdateOne) SaveX(ctx context.Context) *Entitlement
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 ¶
func (euo *EntitlementUpdateOne) Where(ps ...predicate.Entitlement) *EntitlementUpdateOne
Where appends a list predicates to the EntitlementUpdate builder.
type EntitlementUpsert ¶
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 ¶
func (u *EntitlementUpsertBulk) DoNothing() *EntitlementUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*EntitlementUpsertBulk) Exec ¶
func (u *EntitlementUpsertBulk) Exec(ctx context.Context) error
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 ¶
func (u *EntitlementUpsertBulk) Ignore() *EntitlementUpsertBulk
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 ¶
func (u *EntitlementUpsertBulk) SetConfig(v []uint8) *EntitlementUpsertBulk
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 ¶
func (u *EntitlementUpsertBulk) SetDeletedAt(v time.Time) *EntitlementUpsertBulk
SetDeletedAt sets the "deleted_at" field.
func (*EntitlementUpsertBulk) SetMetadata ¶
func (u *EntitlementUpsertBulk) SetMetadata(v map[string]string) *EntitlementUpsertBulk
SetMetadata sets the "metadata" field.
func (*EntitlementUpsertBulk) SetUpdatedAt ¶
func (u *EntitlementUpsertBulk) SetUpdatedAt(v time.Time) *EntitlementUpsertBulk
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 ¶
func (u *EntitlementUpsertBulk) Update(set func(*EntitlementUpsert)) *EntitlementUpsertBulk
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 ¶
func (u *EntitlementUpsertOne) DoNothing() *EntitlementUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*EntitlementUpsertOne) Exec ¶
func (u *EntitlementUpsertOne) Exec(ctx context.Context) error
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 ¶
func (u *EntitlementUpsertOne) IDX(ctx context.Context) string
IDX is like ID, but panics if an error occurs.
func (*EntitlementUpsertOne) Ignore ¶
func (u *EntitlementUpsertOne) Ignore() *EntitlementUpsertOne
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 ¶
func (u *EntitlementUpsertOne) Update(set func(*EntitlementUpsert)) *EntitlementUpsertOne
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
}
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 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 OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
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 ¶
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.
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 ¶
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 Tx ¶
type Tx struct { // Entitlement is the client for interacting with the Entitlement builders. Entitlement *EntitlementClient // 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 ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
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.
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 ¶
func (urd *UsageResetDelete) Where(ps ...predicate.UsageReset) *UsageResetDelete
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 ¶
func (urdo *UsageResetDeleteOne) Where(ps ...predicate.UsageReset) *UsageResetDeleteOne
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 ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UsageResetGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UsageResetGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UsageResetGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UsageResetGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UsageResetGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
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) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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) 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 ¶
func (urq *UsageResetQuery) Order(o ...usagereset.OrderOption) *UsageResetQuery
Order specifies how the records should be ordered.
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 ¶
func (urq *UsageResetQuery) Where(ps ...predicate.UsageReset) *UsageResetQuery
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 ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UsageResetSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UsageResetSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UsageResetSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UsageResetSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UsageResetSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
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) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
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 ¶
func (uru *UsageResetUpdate) Where(ps ...predicate.UsageReset) *UsageResetUpdate
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 ¶
func (uruo *UsageResetUpdateOne) Where(ps ...predicate.UsageReset) *UsageResetUpdateOne
Where appends a list predicates to the UsageResetUpdate builder.
type UsageResetUpsert ¶
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 ¶
func (u *UsageResetUpsertBulk) DoNothing() *UsageResetUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*UsageResetUpsertBulk) Exec ¶
func (u *UsageResetUpsertBulk) Exec(ctx context.Context) error
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 ¶
func (u *UsageResetUpsertBulk) Ignore() *UsageResetUpsertBulk
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 ¶
func (u *UsageResetUpsertBulk) Update(set func(*UsageResetUpsert)) *UsageResetUpsertBulk
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 ¶
func (u *UsageResetUpsertOne) Exec(ctx context.Context) error
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 ¶
func (u *UsageResetUpsertOne) IDX(ctx context.Context) string
IDX is like ID, but panics if an error occurs.
func (*UsageResetUpsertOne) Ignore ¶
func (u *UsageResetUpsertOne) Ignore() *UsageResetUpsertOne
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 ¶
func (u *UsageResetUpsertOne) Update(set func(*UsageResetUpsert)) *UsageResetUpsertOne
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 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.