|
@@ -21,6 +21,7 @@ import (
|
|
|
"wechat-api/ent/employeeconfig"
|
|
|
"wechat-api/ent/label"
|
|
|
"wechat-api/ent/labelrelationship"
|
|
|
+ "wechat-api/ent/labeltagging"
|
|
|
"wechat-api/ent/message"
|
|
|
"wechat-api/ent/messagerecords"
|
|
|
"wechat-api/ent/msg"
|
|
@@ -66,6 +67,7 @@ const (
|
|
|
TypeEmployeeConfig = "EmployeeConfig"
|
|
|
TypeLabel = "Label"
|
|
|
TypeLabelRelationship = "LabelRelationship"
|
|
|
+ TypeLabelTagging = "LabelTagging"
|
|
|
TypeMessage = "Message"
|
|
|
TypeMessageRecords = "MessageRecords"
|
|
|
TypeMsg = "Msg"
|
|
@@ -13991,6 +13993,1042 @@ func (m *LabelRelationshipMutation) ResetEdge(name string) error {
|
|
|
return fmt.Errorf("unknown LabelRelationship edge %s", name)
|
|
|
}
|
|
|
|
|
|
+// LabelTaggingMutation represents an operation that mutates the LabelTagging nodes in the graph.
|
|
|
+type LabelTaggingMutation struct {
|
|
|
+ config
|
|
|
+ op Op
|
|
|
+ typ string
|
|
|
+ id *uint64
|
|
|
+ created_at *time.Time
|
|
|
+ updated_at *time.Time
|
|
|
+ status *uint8
|
|
|
+ addstatus *int8
|
|
|
+ deleted_at *time.Time
|
|
|
+ organization_id *uint64
|
|
|
+ addorganization_id *int64
|
|
|
+ _type *int
|
|
|
+ add_type *int
|
|
|
+ conditions *[]string
|
|
|
+ appendconditions []string
|
|
|
+ action_label_add *[]uint64
|
|
|
+ appendaction_label_add []uint64
|
|
|
+ action_label_del *[]uint64
|
|
|
+ appendaction_label_del []uint64
|
|
|
+ clearedFields map[string]struct{}
|
|
|
+ done bool
|
|
|
+ oldValue func(context.Context) (*LabelTagging, error)
|
|
|
+ predicates []predicate.LabelTagging
|
|
|
+}
|
|
|
+
|
|
|
+var _ ent.Mutation = (*LabelTaggingMutation)(nil)
|
|
|
+
|
|
|
+// labeltaggingOption allows management of the mutation configuration using functional options.
|
|
|
+type labeltaggingOption func(*LabelTaggingMutation)
|
|
|
+
|
|
|
+// newLabelTaggingMutation creates new mutation for the LabelTagging entity.
|
|
|
+func newLabelTaggingMutation(c config, op Op, opts ...labeltaggingOption) *LabelTaggingMutation {
|
|
|
+ m := &LabelTaggingMutation{
|
|
|
+ config: c,
|
|
|
+ op: op,
|
|
|
+ typ: TypeLabelTagging,
|
|
|
+ clearedFields: make(map[string]struct{}),
|
|
|
+ }
|
|
|
+ for _, opt := range opts {
|
|
|
+ opt(m)
|
|
|
+ }
|
|
|
+ return m
|
|
|
+}
|
|
|
+
|
|
|
+// withLabelTaggingID sets the ID field of the mutation.
|
|
|
+func withLabelTaggingID(id uint64) labeltaggingOption {
|
|
|
+ return func(m *LabelTaggingMutation) {
|
|
|
+ var (
|
|
|
+ err error
|
|
|
+ once sync.Once
|
|
|
+ value *LabelTagging
|
|
|
+ )
|
|
|
+ m.oldValue = func(ctx context.Context) (*LabelTagging, error) {
|
|
|
+ once.Do(func() {
|
|
|
+ if m.done {
|
|
|
+ err = errors.New("querying old values post mutation is not allowed")
|
|
|
+ } else {
|
|
|
+ value, err = m.Client().LabelTagging.Get(ctx, id)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return value, err
|
|
|
+ }
|
|
|
+ m.id = &id
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// withLabelTagging sets the old LabelTagging of the mutation.
|
|
|
+func withLabelTagging(node *LabelTagging) labeltaggingOption {
|
|
|
+ return func(m *LabelTaggingMutation) {
|
|
|
+ m.oldValue = func(context.Context) (*LabelTagging, error) {
|
|
|
+ return node, nil
|
|
|
+ }
|
|
|
+ m.id = &node.ID
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 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 (m LabelTaggingMutation) Client() *Client {
|
|
|
+ client := &Client{config: m.config}
|
|
|
+ client.init()
|
|
|
+ return client
|
|
|
+}
|
|
|
+
|
|
|
+// Tx returns an `ent.Tx` for mutations that were executed in transactions;
|
|
|
+// it returns an error otherwise.
|
|
|
+func (m LabelTaggingMutation) Tx() (*Tx, error) {
|
|
|
+ if _, ok := m.driver.(*txDriver); !ok {
|
|
|
+ return nil, errors.New("ent: mutation is not running in a transaction")
|
|
|
+ }
|
|
|
+ tx := &Tx{config: m.config}
|
|
|
+ tx.init()
|
|
|
+ return tx, nil
|
|
|
+}
|
|
|
+
|
|
|
+// SetID sets the value of the id field. Note that this
|
|
|
+// operation is only accepted on creation of LabelTagging entities.
|
|
|
+func (m *LabelTaggingMutation) SetID(id uint64) {
|
|
|
+ m.id = &id
|
|
|
+}
|
|
|
+
|
|
|
+// ID returns the ID value in the mutation. Note that the ID is only available
|
|
|
+// if it was provided to the builder or after it was returned from the database.
|
|
|
+func (m *LabelTaggingMutation) ID() (id uint64, exists bool) {
|
|
|
+ if m.id == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *m.id, true
|
|
|
+}
|
|
|
+
|
|
|
+// 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 (m *LabelTaggingMutation) IDs(ctx context.Context) ([]uint64, error) {
|
|
|
+ switch {
|
|
|
+ case m.op.Is(OpUpdateOne | OpDeleteOne):
|
|
|
+ id, exists := m.ID()
|
|
|
+ if exists {
|
|
|
+ return []uint64{id}, nil
|
|
|
+ }
|
|
|
+ fallthrough
|
|
|
+ case m.op.Is(OpUpdate | OpDelete):
|
|
|
+ return m.Client().LabelTagging.Query().Where(m.predicates...).IDs(ctx)
|
|
|
+ default:
|
|
|
+ return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// SetCreatedAt sets the "created_at" field.
|
|
|
+func (m *LabelTaggingMutation) SetCreatedAt(t time.Time) {
|
|
|
+ m.created_at = &t
|
|
|
+}
|
|
|
+
|
|
|
+// CreatedAt returns the value of the "created_at" field in the mutation.
|
|
|
+func (m *LabelTaggingMutation) CreatedAt() (r time.Time, exists bool) {
|
|
|
+ v := m.created_at
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldCreatedAt returns the old "created_at" field's value of the LabelTagging entity.
|
|
|
+// If the LabelTagging 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 (m *LabelTaggingMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldCreatedAt requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.CreatedAt, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ResetCreatedAt resets all changes to the "created_at" field.
|
|
|
+func (m *LabelTaggingMutation) ResetCreatedAt() {
|
|
|
+ m.created_at = nil
|
|
|
+}
|
|
|
+
|
|
|
+// SetUpdatedAt sets the "updated_at" field.
|
|
|
+func (m *LabelTaggingMutation) SetUpdatedAt(t time.Time) {
|
|
|
+ m.updated_at = &t
|
|
|
+}
|
|
|
+
|
|
|
+// UpdatedAt returns the value of the "updated_at" field in the mutation.
|
|
|
+func (m *LabelTaggingMutation) UpdatedAt() (r time.Time, exists bool) {
|
|
|
+ v := m.updated_at
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldUpdatedAt returns the old "updated_at" field's value of the LabelTagging entity.
|
|
|
+// If the LabelTagging 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 (m *LabelTaggingMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldUpdatedAt requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.UpdatedAt, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ResetUpdatedAt resets all changes to the "updated_at" field.
|
|
|
+func (m *LabelTaggingMutation) ResetUpdatedAt() {
|
|
|
+ m.updated_at = nil
|
|
|
+}
|
|
|
+
|
|
|
+// SetStatus sets the "status" field.
|
|
|
+func (m *LabelTaggingMutation) SetStatus(u uint8) {
|
|
|
+ m.status = &u
|
|
|
+ m.addstatus = nil
|
|
|
+}
|
|
|
+
|
|
|
+// Status returns the value of the "status" field in the mutation.
|
|
|
+func (m *LabelTaggingMutation) Status() (r uint8, exists bool) {
|
|
|
+ v := m.status
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldStatus returns the old "status" field's value of the LabelTagging entity.
|
|
|
+// If the LabelTagging 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 (m *LabelTaggingMutation) OldStatus(ctx context.Context) (v uint8, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldStatus is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldStatus requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldStatus: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.Status, nil
|
|
|
+}
|
|
|
+
|
|
|
+// AddStatus adds u to the "status" field.
|
|
|
+func (m *LabelTaggingMutation) AddStatus(u int8) {
|
|
|
+ if m.addstatus != nil {
|
|
|
+ *m.addstatus += u
|
|
|
+ } else {
|
|
|
+ m.addstatus = &u
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// AddedStatus returns the value that was added to the "status" field in this mutation.
|
|
|
+func (m *LabelTaggingMutation) AddedStatus() (r int8, exists bool) {
|
|
|
+ v := m.addstatus
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// ClearStatus clears the value of the "status" field.
|
|
|
+func (m *LabelTaggingMutation) ClearStatus() {
|
|
|
+ m.status = nil
|
|
|
+ m.addstatus = nil
|
|
|
+ m.clearedFields[labeltagging.FieldStatus] = struct{}{}
|
|
|
+}
|
|
|
+
|
|
|
+// StatusCleared returns if the "status" field was cleared in this mutation.
|
|
|
+func (m *LabelTaggingMutation) StatusCleared() bool {
|
|
|
+ _, ok := m.clearedFields[labeltagging.FieldStatus]
|
|
|
+ return ok
|
|
|
+}
|
|
|
+
|
|
|
+// ResetStatus resets all changes to the "status" field.
|
|
|
+func (m *LabelTaggingMutation) ResetStatus() {
|
|
|
+ m.status = nil
|
|
|
+ m.addstatus = nil
|
|
|
+ delete(m.clearedFields, labeltagging.FieldStatus)
|
|
|
+}
|
|
|
+
|
|
|
+// SetDeletedAt sets the "deleted_at" field.
|
|
|
+func (m *LabelTaggingMutation) SetDeletedAt(t time.Time) {
|
|
|
+ m.deleted_at = &t
|
|
|
+}
|
|
|
+
|
|
|
+// DeletedAt returns the value of the "deleted_at" field in the mutation.
|
|
|
+func (m *LabelTaggingMutation) DeletedAt() (r time.Time, exists bool) {
|
|
|
+ v := m.deleted_at
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldDeletedAt returns the old "deleted_at" field's value of the LabelTagging entity.
|
|
|
+// If the LabelTagging 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 (m *LabelTaggingMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldDeletedAt requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.DeletedAt, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ClearDeletedAt clears the value of the "deleted_at" field.
|
|
|
+func (m *LabelTaggingMutation) ClearDeletedAt() {
|
|
|
+ m.deleted_at = nil
|
|
|
+ m.clearedFields[labeltagging.FieldDeletedAt] = struct{}{}
|
|
|
+}
|
|
|
+
|
|
|
+// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.
|
|
|
+func (m *LabelTaggingMutation) DeletedAtCleared() bool {
|
|
|
+ _, ok := m.clearedFields[labeltagging.FieldDeletedAt]
|
|
|
+ return ok
|
|
|
+}
|
|
|
+
|
|
|
+// ResetDeletedAt resets all changes to the "deleted_at" field.
|
|
|
+func (m *LabelTaggingMutation) ResetDeletedAt() {
|
|
|
+ m.deleted_at = nil
|
|
|
+ delete(m.clearedFields, labeltagging.FieldDeletedAt)
|
|
|
+}
|
|
|
+
|
|
|
+// SetOrganizationID sets the "organization_id" field.
|
|
|
+func (m *LabelTaggingMutation) SetOrganizationID(u uint64) {
|
|
|
+ m.organization_id = &u
|
|
|
+ m.addorganization_id = nil
|
|
|
+}
|
|
|
+
|
|
|
+// OrganizationID returns the value of the "organization_id" field in the mutation.
|
|
|
+func (m *LabelTaggingMutation) OrganizationID() (r uint64, exists bool) {
|
|
|
+ v := m.organization_id
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldOrganizationID returns the old "organization_id" field's value of the LabelTagging entity.
|
|
|
+// If the LabelTagging 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 (m *LabelTaggingMutation) OldOrganizationID(ctx context.Context) (v uint64, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldOrganizationID is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldOrganizationID requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldOrganizationID: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.OrganizationID, nil
|
|
|
+}
|
|
|
+
|
|
|
+// AddOrganizationID adds u to the "organization_id" field.
|
|
|
+func (m *LabelTaggingMutation) AddOrganizationID(u int64) {
|
|
|
+ if m.addorganization_id != nil {
|
|
|
+ *m.addorganization_id += u
|
|
|
+ } else {
|
|
|
+ m.addorganization_id = &u
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// AddedOrganizationID returns the value that was added to the "organization_id" field in this mutation.
|
|
|
+func (m *LabelTaggingMutation) AddedOrganizationID() (r int64, exists bool) {
|
|
|
+ v := m.addorganization_id
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// ClearOrganizationID clears the value of the "organization_id" field.
|
|
|
+func (m *LabelTaggingMutation) ClearOrganizationID() {
|
|
|
+ m.organization_id = nil
|
|
|
+ m.addorganization_id = nil
|
|
|
+ m.clearedFields[labeltagging.FieldOrganizationID] = struct{}{}
|
|
|
+}
|
|
|
+
|
|
|
+// OrganizationIDCleared returns if the "organization_id" field was cleared in this mutation.
|
|
|
+func (m *LabelTaggingMutation) OrganizationIDCleared() bool {
|
|
|
+ _, ok := m.clearedFields[labeltagging.FieldOrganizationID]
|
|
|
+ return ok
|
|
|
+}
|
|
|
+
|
|
|
+// ResetOrganizationID resets all changes to the "organization_id" field.
|
|
|
+func (m *LabelTaggingMutation) ResetOrganizationID() {
|
|
|
+ m.organization_id = nil
|
|
|
+ m.addorganization_id = nil
|
|
|
+ delete(m.clearedFields, labeltagging.FieldOrganizationID)
|
|
|
+}
|
|
|
+
|
|
|
+// SetType sets the "type" field.
|
|
|
+func (m *LabelTaggingMutation) SetType(i int) {
|
|
|
+ m._type = &i
|
|
|
+ m.add_type = nil
|
|
|
+}
|
|
|
+
|
|
|
+// GetType returns the value of the "type" field in the mutation.
|
|
|
+func (m *LabelTaggingMutation) GetType() (r int, exists bool) {
|
|
|
+ v := m._type
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldType returns the old "type" field's value of the LabelTagging entity.
|
|
|
+// If the LabelTagging 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 (m *LabelTaggingMutation) OldType(ctx context.Context) (v int, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldType is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldType requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldType: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.Type, nil
|
|
|
+}
|
|
|
+
|
|
|
+// AddType adds i to the "type" field.
|
|
|
+func (m *LabelTaggingMutation) AddType(i int) {
|
|
|
+ if m.add_type != nil {
|
|
|
+ *m.add_type += i
|
|
|
+ } else {
|
|
|
+ m.add_type = &i
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// AddedType returns the value that was added to the "type" field in this mutation.
|
|
|
+func (m *LabelTaggingMutation) AddedType() (r int, exists bool) {
|
|
|
+ v := m.add_type
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// ResetType resets all changes to the "type" field.
|
|
|
+func (m *LabelTaggingMutation) ResetType() {
|
|
|
+ m._type = nil
|
|
|
+ m.add_type = nil
|
|
|
+}
|
|
|
+
|
|
|
+// SetConditions sets the "conditions" field.
|
|
|
+func (m *LabelTaggingMutation) SetConditions(s []string) {
|
|
|
+ m.conditions = &s
|
|
|
+ m.appendconditions = nil
|
|
|
+}
|
|
|
+
|
|
|
+// Conditions returns the value of the "conditions" field in the mutation.
|
|
|
+func (m *LabelTaggingMutation) Conditions() (r []string, exists bool) {
|
|
|
+ v := m.conditions
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldConditions returns the old "conditions" field's value of the LabelTagging entity.
|
|
|
+// If the LabelTagging 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 (m *LabelTaggingMutation) OldConditions(ctx context.Context) (v []string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldConditions is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldConditions requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldConditions: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.Conditions, nil
|
|
|
+}
|
|
|
+
|
|
|
+// AppendConditions adds s to the "conditions" field.
|
|
|
+func (m *LabelTaggingMutation) AppendConditions(s []string) {
|
|
|
+ m.appendconditions = append(m.appendconditions, s...)
|
|
|
+}
|
|
|
+
|
|
|
+// AppendedConditions returns the list of values that were appended to the "conditions" field in this mutation.
|
|
|
+func (m *LabelTaggingMutation) AppendedConditions() ([]string, bool) {
|
|
|
+ if len(m.appendconditions) == 0 {
|
|
|
+ return nil, false
|
|
|
+ }
|
|
|
+ return m.appendconditions, true
|
|
|
+}
|
|
|
+
|
|
|
+// ClearConditions clears the value of the "conditions" field.
|
|
|
+func (m *LabelTaggingMutation) ClearConditions() {
|
|
|
+ m.conditions = nil
|
|
|
+ m.appendconditions = nil
|
|
|
+ m.clearedFields[labeltagging.FieldConditions] = struct{}{}
|
|
|
+}
|
|
|
+
|
|
|
+// ConditionsCleared returns if the "conditions" field was cleared in this mutation.
|
|
|
+func (m *LabelTaggingMutation) ConditionsCleared() bool {
|
|
|
+ _, ok := m.clearedFields[labeltagging.FieldConditions]
|
|
|
+ return ok
|
|
|
+}
|
|
|
+
|
|
|
+// ResetConditions resets all changes to the "conditions" field.
|
|
|
+func (m *LabelTaggingMutation) ResetConditions() {
|
|
|
+ m.conditions = nil
|
|
|
+ m.appendconditions = nil
|
|
|
+ delete(m.clearedFields, labeltagging.FieldConditions)
|
|
|
+}
|
|
|
+
|
|
|
+// SetActionLabelAdd sets the "action_label_add" field.
|
|
|
+func (m *LabelTaggingMutation) SetActionLabelAdd(u []uint64) {
|
|
|
+ m.action_label_add = &u
|
|
|
+ m.appendaction_label_add = nil
|
|
|
+}
|
|
|
+
|
|
|
+// ActionLabelAdd returns the value of the "action_label_add" field in the mutation.
|
|
|
+func (m *LabelTaggingMutation) ActionLabelAdd() (r []uint64, exists bool) {
|
|
|
+ v := m.action_label_add
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldActionLabelAdd returns the old "action_label_add" field's value of the LabelTagging entity.
|
|
|
+// If the LabelTagging 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 (m *LabelTaggingMutation) OldActionLabelAdd(ctx context.Context) (v []uint64, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldActionLabelAdd is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldActionLabelAdd requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldActionLabelAdd: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.ActionLabelAdd, nil
|
|
|
+}
|
|
|
+
|
|
|
+// AppendActionLabelAdd adds u to the "action_label_add" field.
|
|
|
+func (m *LabelTaggingMutation) AppendActionLabelAdd(u []uint64) {
|
|
|
+ m.appendaction_label_add = append(m.appendaction_label_add, u...)
|
|
|
+}
|
|
|
+
|
|
|
+// AppendedActionLabelAdd returns the list of values that were appended to the "action_label_add" field in this mutation.
|
|
|
+func (m *LabelTaggingMutation) AppendedActionLabelAdd() ([]uint64, bool) {
|
|
|
+ if len(m.appendaction_label_add) == 0 {
|
|
|
+ return nil, false
|
|
|
+ }
|
|
|
+ return m.appendaction_label_add, true
|
|
|
+}
|
|
|
+
|
|
|
+// ClearActionLabelAdd clears the value of the "action_label_add" field.
|
|
|
+func (m *LabelTaggingMutation) ClearActionLabelAdd() {
|
|
|
+ m.action_label_add = nil
|
|
|
+ m.appendaction_label_add = nil
|
|
|
+ m.clearedFields[labeltagging.FieldActionLabelAdd] = struct{}{}
|
|
|
+}
|
|
|
+
|
|
|
+// ActionLabelAddCleared returns if the "action_label_add" field was cleared in this mutation.
|
|
|
+func (m *LabelTaggingMutation) ActionLabelAddCleared() bool {
|
|
|
+ _, ok := m.clearedFields[labeltagging.FieldActionLabelAdd]
|
|
|
+ return ok
|
|
|
+}
|
|
|
+
|
|
|
+// ResetActionLabelAdd resets all changes to the "action_label_add" field.
|
|
|
+func (m *LabelTaggingMutation) ResetActionLabelAdd() {
|
|
|
+ m.action_label_add = nil
|
|
|
+ m.appendaction_label_add = nil
|
|
|
+ delete(m.clearedFields, labeltagging.FieldActionLabelAdd)
|
|
|
+}
|
|
|
+
|
|
|
+// SetActionLabelDel sets the "action_label_del" field.
|
|
|
+func (m *LabelTaggingMutation) SetActionLabelDel(u []uint64) {
|
|
|
+ m.action_label_del = &u
|
|
|
+ m.appendaction_label_del = nil
|
|
|
+}
|
|
|
+
|
|
|
+// ActionLabelDel returns the value of the "action_label_del" field in the mutation.
|
|
|
+func (m *LabelTaggingMutation) ActionLabelDel() (r []uint64, exists bool) {
|
|
|
+ v := m.action_label_del
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldActionLabelDel returns the old "action_label_del" field's value of the LabelTagging entity.
|
|
|
+// If the LabelTagging 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 (m *LabelTaggingMutation) OldActionLabelDel(ctx context.Context) (v []uint64, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldActionLabelDel is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldActionLabelDel requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldActionLabelDel: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.ActionLabelDel, nil
|
|
|
+}
|
|
|
+
|
|
|
+// AppendActionLabelDel adds u to the "action_label_del" field.
|
|
|
+func (m *LabelTaggingMutation) AppendActionLabelDel(u []uint64) {
|
|
|
+ m.appendaction_label_del = append(m.appendaction_label_del, u...)
|
|
|
+}
|
|
|
+
|
|
|
+// AppendedActionLabelDel returns the list of values that were appended to the "action_label_del" field in this mutation.
|
|
|
+func (m *LabelTaggingMutation) AppendedActionLabelDel() ([]uint64, bool) {
|
|
|
+ if len(m.appendaction_label_del) == 0 {
|
|
|
+ return nil, false
|
|
|
+ }
|
|
|
+ return m.appendaction_label_del, true
|
|
|
+}
|
|
|
+
|
|
|
+// ClearActionLabelDel clears the value of the "action_label_del" field.
|
|
|
+func (m *LabelTaggingMutation) ClearActionLabelDel() {
|
|
|
+ m.action_label_del = nil
|
|
|
+ m.appendaction_label_del = nil
|
|
|
+ m.clearedFields[labeltagging.FieldActionLabelDel] = struct{}{}
|
|
|
+}
|
|
|
+
|
|
|
+// ActionLabelDelCleared returns if the "action_label_del" field was cleared in this mutation.
|
|
|
+func (m *LabelTaggingMutation) ActionLabelDelCleared() bool {
|
|
|
+ _, ok := m.clearedFields[labeltagging.FieldActionLabelDel]
|
|
|
+ return ok
|
|
|
+}
|
|
|
+
|
|
|
+// ResetActionLabelDel resets all changes to the "action_label_del" field.
|
|
|
+func (m *LabelTaggingMutation) ResetActionLabelDel() {
|
|
|
+ m.action_label_del = nil
|
|
|
+ m.appendaction_label_del = nil
|
|
|
+ delete(m.clearedFields, labeltagging.FieldActionLabelDel)
|
|
|
+}
|
|
|
+
|
|
|
+// Where appends a list predicates to the LabelTaggingMutation builder.
|
|
|
+func (m *LabelTaggingMutation) Where(ps ...predicate.LabelTagging) {
|
|
|
+ m.predicates = append(m.predicates, ps...)
|
|
|
+}
|
|
|
+
|
|
|
+// WhereP appends storage-level predicates to the LabelTaggingMutation builder. Using this method,
|
|
|
+// users can use type-assertion to append predicates that do not depend on any generated package.
|
|
|
+func (m *LabelTaggingMutation) WhereP(ps ...func(*sql.Selector)) {
|
|
|
+ p := make([]predicate.LabelTagging, len(ps))
|
|
|
+ for i := range ps {
|
|
|
+ p[i] = ps[i]
|
|
|
+ }
|
|
|
+ m.Where(p...)
|
|
|
+}
|
|
|
+
|
|
|
+// Op returns the operation name.
|
|
|
+func (m *LabelTaggingMutation) Op() Op {
|
|
|
+ return m.op
|
|
|
+}
|
|
|
+
|
|
|
+// SetOp allows setting the mutation operation.
|
|
|
+func (m *LabelTaggingMutation) SetOp(op Op) {
|
|
|
+ m.op = op
|
|
|
+}
|
|
|
+
|
|
|
+// Type returns the node type of this mutation (LabelTagging).
|
|
|
+func (m *LabelTaggingMutation) Type() string {
|
|
|
+ return m.typ
|
|
|
+}
|
|
|
+
|
|
|
+// 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 (m *LabelTaggingMutation) Fields() []string {
|
|
|
+ fields := make([]string, 0, 9)
|
|
|
+ if m.created_at != nil {
|
|
|
+ fields = append(fields, labeltagging.FieldCreatedAt)
|
|
|
+ }
|
|
|
+ if m.updated_at != nil {
|
|
|
+ fields = append(fields, labeltagging.FieldUpdatedAt)
|
|
|
+ }
|
|
|
+ if m.status != nil {
|
|
|
+ fields = append(fields, labeltagging.FieldStatus)
|
|
|
+ }
|
|
|
+ if m.deleted_at != nil {
|
|
|
+ fields = append(fields, labeltagging.FieldDeletedAt)
|
|
|
+ }
|
|
|
+ if m.organization_id != nil {
|
|
|
+ fields = append(fields, labeltagging.FieldOrganizationID)
|
|
|
+ }
|
|
|
+ if m._type != nil {
|
|
|
+ fields = append(fields, labeltagging.FieldType)
|
|
|
+ }
|
|
|
+ if m.conditions != nil {
|
|
|
+ fields = append(fields, labeltagging.FieldConditions)
|
|
|
+ }
|
|
|
+ if m.action_label_add != nil {
|
|
|
+ fields = append(fields, labeltagging.FieldActionLabelAdd)
|
|
|
+ }
|
|
|
+ if m.action_label_del != nil {
|
|
|
+ fields = append(fields, labeltagging.FieldActionLabelDel)
|
|
|
+ }
|
|
|
+ return fields
|
|
|
+}
|
|
|
+
|
|
|
+// 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 (m *LabelTaggingMutation) Field(name string) (ent.Value, bool) {
|
|
|
+ switch name {
|
|
|
+ case labeltagging.FieldCreatedAt:
|
|
|
+ return m.CreatedAt()
|
|
|
+ case labeltagging.FieldUpdatedAt:
|
|
|
+ return m.UpdatedAt()
|
|
|
+ case labeltagging.FieldStatus:
|
|
|
+ return m.Status()
|
|
|
+ case labeltagging.FieldDeletedAt:
|
|
|
+ return m.DeletedAt()
|
|
|
+ case labeltagging.FieldOrganizationID:
|
|
|
+ return m.OrganizationID()
|
|
|
+ case labeltagging.FieldType:
|
|
|
+ return m.GetType()
|
|
|
+ case labeltagging.FieldConditions:
|
|
|
+ return m.Conditions()
|
|
|
+ case labeltagging.FieldActionLabelAdd:
|
|
|
+ return m.ActionLabelAdd()
|
|
|
+ case labeltagging.FieldActionLabelDel:
|
|
|
+ return m.ActionLabelDel()
|
|
|
+ }
|
|
|
+ return nil, false
|
|
|
+}
|
|
|
+
|
|
|
+// 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 (m *LabelTaggingMutation) OldField(ctx context.Context, name string) (ent.Value, error) {
|
|
|
+ switch name {
|
|
|
+ case labeltagging.FieldCreatedAt:
|
|
|
+ return m.OldCreatedAt(ctx)
|
|
|
+ case labeltagging.FieldUpdatedAt:
|
|
|
+ return m.OldUpdatedAt(ctx)
|
|
|
+ case labeltagging.FieldStatus:
|
|
|
+ return m.OldStatus(ctx)
|
|
|
+ case labeltagging.FieldDeletedAt:
|
|
|
+ return m.OldDeletedAt(ctx)
|
|
|
+ case labeltagging.FieldOrganizationID:
|
|
|
+ return m.OldOrganizationID(ctx)
|
|
|
+ case labeltagging.FieldType:
|
|
|
+ return m.OldType(ctx)
|
|
|
+ case labeltagging.FieldConditions:
|
|
|
+ return m.OldConditions(ctx)
|
|
|
+ case labeltagging.FieldActionLabelAdd:
|
|
|
+ return m.OldActionLabelAdd(ctx)
|
|
|
+ case labeltagging.FieldActionLabelDel:
|
|
|
+ return m.OldActionLabelDel(ctx)
|
|
|
+ }
|
|
|
+ return nil, fmt.Errorf("unknown LabelTagging field %s", name)
|
|
|
+}
|
|
|
+
|
|
|
+// 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 (m *LabelTaggingMutation) SetField(name string, value ent.Value) error {
|
|
|
+ switch name {
|
|
|
+ case labeltagging.FieldCreatedAt:
|
|
|
+ v, ok := value.(time.Time)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetCreatedAt(v)
|
|
|
+ return nil
|
|
|
+ case labeltagging.FieldUpdatedAt:
|
|
|
+ v, ok := value.(time.Time)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetUpdatedAt(v)
|
|
|
+ return nil
|
|
|
+ case labeltagging.FieldStatus:
|
|
|
+ v, ok := value.(uint8)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetStatus(v)
|
|
|
+ return nil
|
|
|
+ case labeltagging.FieldDeletedAt:
|
|
|
+ v, ok := value.(time.Time)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetDeletedAt(v)
|
|
|
+ return nil
|
|
|
+ case labeltagging.FieldOrganizationID:
|
|
|
+ v, ok := value.(uint64)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetOrganizationID(v)
|
|
|
+ return nil
|
|
|
+ case labeltagging.FieldType:
|
|
|
+ v, ok := value.(int)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetType(v)
|
|
|
+ return nil
|
|
|
+ case labeltagging.FieldConditions:
|
|
|
+ v, ok := value.([]string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetConditions(v)
|
|
|
+ return nil
|
|
|
+ case labeltagging.FieldActionLabelAdd:
|
|
|
+ v, ok := value.([]uint64)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetActionLabelAdd(v)
|
|
|
+ return nil
|
|
|
+ case labeltagging.FieldActionLabelDel:
|
|
|
+ v, ok := value.([]uint64)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetActionLabelDel(v)
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+ return fmt.Errorf("unknown LabelTagging field %s", name)
|
|
|
+}
|
|
|
+
|
|
|
+// AddedFields returns all numeric fields that were incremented/decremented during
|
|
|
+// this mutation.
|
|
|
+func (m *LabelTaggingMutation) AddedFields() []string {
|
|
|
+ var fields []string
|
|
|
+ if m.addstatus != nil {
|
|
|
+ fields = append(fields, labeltagging.FieldStatus)
|
|
|
+ }
|
|
|
+ if m.addorganization_id != nil {
|
|
|
+ fields = append(fields, labeltagging.FieldOrganizationID)
|
|
|
+ }
|
|
|
+ if m.add_type != nil {
|
|
|
+ fields = append(fields, labeltagging.FieldType)
|
|
|
+ }
|
|
|
+ return fields
|
|
|
+}
|
|
|
+
|
|
|
+// 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 (m *LabelTaggingMutation) AddedField(name string) (ent.Value, bool) {
|
|
|
+ switch name {
|
|
|
+ case labeltagging.FieldStatus:
|
|
|
+ return m.AddedStatus()
|
|
|
+ case labeltagging.FieldOrganizationID:
|
|
|
+ return m.AddedOrganizationID()
|
|
|
+ case labeltagging.FieldType:
|
|
|
+ return m.AddedType()
|
|
|
+ }
|
|
|
+ return nil, false
|
|
|
+}
|
|
|
+
|
|
|
+// 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 (m *LabelTaggingMutation) AddField(name string, value ent.Value) error {
|
|
|
+ switch name {
|
|
|
+ case labeltagging.FieldStatus:
|
|
|
+ v, ok := value.(int8)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.AddStatus(v)
|
|
|
+ return nil
|
|
|
+ case labeltagging.FieldOrganizationID:
|
|
|
+ v, ok := value.(int64)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.AddOrganizationID(v)
|
|
|
+ return nil
|
|
|
+ case labeltagging.FieldType:
|
|
|
+ v, ok := value.(int)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.AddType(v)
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+ return fmt.Errorf("unknown LabelTagging numeric field %s", name)
|
|
|
+}
|
|
|
+
|
|
|
+// ClearedFields returns all nullable fields that were cleared during this
|
|
|
+// mutation.
|
|
|
+func (m *LabelTaggingMutation) ClearedFields() []string {
|
|
|
+ var fields []string
|
|
|
+ if m.FieldCleared(labeltagging.FieldStatus) {
|
|
|
+ fields = append(fields, labeltagging.FieldStatus)
|
|
|
+ }
|
|
|
+ if m.FieldCleared(labeltagging.FieldDeletedAt) {
|
|
|
+ fields = append(fields, labeltagging.FieldDeletedAt)
|
|
|
+ }
|
|
|
+ if m.FieldCleared(labeltagging.FieldOrganizationID) {
|
|
|
+ fields = append(fields, labeltagging.FieldOrganizationID)
|
|
|
+ }
|
|
|
+ if m.FieldCleared(labeltagging.FieldConditions) {
|
|
|
+ fields = append(fields, labeltagging.FieldConditions)
|
|
|
+ }
|
|
|
+ if m.FieldCleared(labeltagging.FieldActionLabelAdd) {
|
|
|
+ fields = append(fields, labeltagging.FieldActionLabelAdd)
|
|
|
+ }
|
|
|
+ if m.FieldCleared(labeltagging.FieldActionLabelDel) {
|
|
|
+ fields = append(fields, labeltagging.FieldActionLabelDel)
|
|
|
+ }
|
|
|
+ return fields
|
|
|
+}
|
|
|
+
|
|
|
+// FieldCleared returns a boolean indicating if a field with the given name was
|
|
|
+// cleared in this mutation.
|
|
|
+func (m *LabelTaggingMutation) FieldCleared(name string) bool {
|
|
|
+ _, ok := m.clearedFields[name]
|
|
|
+ return ok
|
|
|
+}
|
|
|
+
|
|
|
+// 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 (m *LabelTaggingMutation) ClearField(name string) error {
|
|
|
+ switch name {
|
|
|
+ case labeltagging.FieldStatus:
|
|
|
+ m.ClearStatus()
|
|
|
+ return nil
|
|
|
+ case labeltagging.FieldDeletedAt:
|
|
|
+ m.ClearDeletedAt()
|
|
|
+ return nil
|
|
|
+ case labeltagging.FieldOrganizationID:
|
|
|
+ m.ClearOrganizationID()
|
|
|
+ return nil
|
|
|
+ case labeltagging.FieldConditions:
|
|
|
+ m.ClearConditions()
|
|
|
+ return nil
|
|
|
+ case labeltagging.FieldActionLabelAdd:
|
|
|
+ m.ClearActionLabelAdd()
|
|
|
+ return nil
|
|
|
+ case labeltagging.FieldActionLabelDel:
|
|
|
+ m.ClearActionLabelDel()
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+ return fmt.Errorf("unknown LabelTagging nullable field %s", name)
|
|
|
+}
|
|
|
+
|
|
|
+// 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 (m *LabelTaggingMutation) ResetField(name string) error {
|
|
|
+ switch name {
|
|
|
+ case labeltagging.FieldCreatedAt:
|
|
|
+ m.ResetCreatedAt()
|
|
|
+ return nil
|
|
|
+ case labeltagging.FieldUpdatedAt:
|
|
|
+ m.ResetUpdatedAt()
|
|
|
+ return nil
|
|
|
+ case labeltagging.FieldStatus:
|
|
|
+ m.ResetStatus()
|
|
|
+ return nil
|
|
|
+ case labeltagging.FieldDeletedAt:
|
|
|
+ m.ResetDeletedAt()
|
|
|
+ return nil
|
|
|
+ case labeltagging.FieldOrganizationID:
|
|
|
+ m.ResetOrganizationID()
|
|
|
+ return nil
|
|
|
+ case labeltagging.FieldType:
|
|
|
+ m.ResetType()
|
|
|
+ return nil
|
|
|
+ case labeltagging.FieldConditions:
|
|
|
+ m.ResetConditions()
|
|
|
+ return nil
|
|
|
+ case labeltagging.FieldActionLabelAdd:
|
|
|
+ m.ResetActionLabelAdd()
|
|
|
+ return nil
|
|
|
+ case labeltagging.FieldActionLabelDel:
|
|
|
+ m.ResetActionLabelDel()
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+ return fmt.Errorf("unknown LabelTagging field %s", name)
|
|
|
+}
|
|
|
+
|
|
|
+// AddedEdges returns all edge names that were set/added in this mutation.
|
|
|
+func (m *LabelTaggingMutation) AddedEdges() []string {
|
|
|
+ edges := make([]string, 0, 0)
|
|
|
+ return edges
|
|
|
+}
|
|
|
+
|
|
|
+// AddedIDs returns all IDs (to other nodes) that were added for the given edge
|
|
|
+// name in this mutation.
|
|
|
+func (m *LabelTaggingMutation) AddedIDs(name string) []ent.Value {
|
|
|
+ return nil
|
|
|
+}
|
|
|
+
|
|
|
+// RemovedEdges returns all edge names that were removed in this mutation.
|
|
|
+func (m *LabelTaggingMutation) RemovedEdges() []string {
|
|
|
+ edges := make([]string, 0, 0)
|
|
|
+ return edges
|
|
|
+}
|
|
|
+
|
|
|
+// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with
|
|
|
+// the given name in this mutation.
|
|
|
+func (m *LabelTaggingMutation) RemovedIDs(name string) []ent.Value {
|
|
|
+ return nil
|
|
|
+}
|
|
|
+
|
|
|
+// ClearedEdges returns all edge names that were cleared in this mutation.
|
|
|
+func (m *LabelTaggingMutation) ClearedEdges() []string {
|
|
|
+ edges := make([]string, 0, 0)
|
|
|
+ return edges
|
|
|
+}
|
|
|
+
|
|
|
+// EdgeCleared returns a boolean which indicates if the edge with the given name
|
|
|
+// was cleared in this mutation.
|
|
|
+func (m *LabelTaggingMutation) EdgeCleared(name string) bool {
|
|
|
+ return false
|
|
|
+}
|
|
|
+
|
|
|
+// 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 (m *LabelTaggingMutation) ClearEdge(name string) error {
|
|
|
+ return fmt.Errorf("unknown LabelTagging unique edge %s", name)
|
|
|
+}
|
|
|
+
|
|
|
+// 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 (m *LabelTaggingMutation) ResetEdge(name string) error {
|
|
|
+ return fmt.Errorf("unknown LabelTagging edge %s", name)
|
|
|
+}
|
|
|
+
|
|
|
// MessageMutation represents an operation that mutates the Message nodes in the graph.
|
|
|
type MessageMutation struct {
|
|
|
config
|