// Code generated by ent, DO NOT EDIT.

package serversitemicros

import (
	"context"
	"convert-server/domain/entity/serversitemicros/docservercallback"
	"convert-server/domain/entity/serversitemicros/predicate"
	"errors"
	"fmt"
	"time"

	"entgo.io/ent/dialect/sql"
	"entgo.io/ent/dialect/sql/sqlgraph"
	"entgo.io/ent/schema/field"
)

// DocServerCallbackUpdate is the builder for updating DocServerCallback entities.
type DocServerCallbackUpdate struct {
	config
	hooks    []Hook
	mutation *DocServerCallbackMutation
}

// Where appends a list predicates to the DocServerCallbackUpdate builder.
func (dscu *DocServerCallbackUpdate) Where(ps ...predicate.DocServerCallback) *DocServerCallbackUpdate {
	dscu.mutation.Where(ps...)
	return dscu
}

// SetServerProjectID sets the "server_project_id" field.
func (dscu *DocServerCallbackUpdate) SetServerProjectID(i int32) *DocServerCallbackUpdate {
	dscu.mutation.ResetServerProjectID()
	dscu.mutation.SetServerProjectID(i)
	return dscu
}

// SetNillableServerProjectID sets the "server_project_id" field if the given value is not nil.
func (dscu *DocServerCallbackUpdate) SetNillableServerProjectID(i *int32) *DocServerCallbackUpdate {
	if i != nil {
		dscu.SetServerProjectID(*i)
	}
	return dscu
}

// AddServerProjectID adds i to the "server_project_id" field.
func (dscu *DocServerCallbackUpdate) AddServerProjectID(i int32) *DocServerCallbackUpdate {
	dscu.mutation.AddServerProjectID(i)
	return dscu
}

// SetCallbackURL sets the "callback_url" field.
func (dscu *DocServerCallbackUpdate) SetCallbackURL(s string) *DocServerCallbackUpdate {
	dscu.mutation.SetCallbackURL(s)
	return dscu
}

// SetNillableCallbackURL sets the "callback_url" field if the given value is not nil.
func (dscu *DocServerCallbackUpdate) SetNillableCallbackURL(s *string) *DocServerCallbackUpdate {
	if s != nil {
		dscu.SetCallbackURL(*s)
	}
	return dscu
}

// SetCallbackData sets the "callback_data" field.
func (dscu *DocServerCallbackUpdate) SetCallbackData(s string) *DocServerCallbackUpdate {
	dscu.mutation.SetCallbackData(s)
	return dscu
}

// SetNillableCallbackData sets the "callback_data" field if the given value is not nil.
func (dscu *DocServerCallbackUpdate) SetNillableCallbackData(s *string) *DocServerCallbackUpdate {
	if s != nil {
		dscu.SetCallbackData(*s)
	}
	return dscu
}

// SetCallbackType sets the "callback_type" field.
func (dscu *DocServerCallbackUpdate) SetCallbackType(i int8) *DocServerCallbackUpdate {
	dscu.mutation.ResetCallbackType()
	dscu.mutation.SetCallbackType(i)
	return dscu
}

// SetNillableCallbackType sets the "callback_type" field if the given value is not nil.
func (dscu *DocServerCallbackUpdate) SetNillableCallbackType(i *int8) *DocServerCallbackUpdate {
	if i != nil {
		dscu.SetCallbackType(*i)
	}
	return dscu
}

// AddCallbackType adds i to the "callback_type" field.
func (dscu *DocServerCallbackUpdate) AddCallbackType(i int8) *DocServerCallbackUpdate {
	dscu.mutation.AddCallbackType(i)
	return dscu
}

// SetStatus sets the "status" field.
func (dscu *DocServerCallbackUpdate) SetStatus(i int8) *DocServerCallbackUpdate {
	dscu.mutation.ResetStatus()
	dscu.mutation.SetStatus(i)
	return dscu
}

// SetNillableStatus sets the "status" field if the given value is not nil.
func (dscu *DocServerCallbackUpdate) SetNillableStatus(i *int8) *DocServerCallbackUpdate {
	if i != nil {
		dscu.SetStatus(*i)
	}
	return dscu
}

// AddStatus adds i to the "status" field.
func (dscu *DocServerCallbackUpdate) AddStatus(i int8) *DocServerCallbackUpdate {
	dscu.mutation.AddStatus(i)
	return dscu
}

// SetCurrNum sets the "curr_num" field.
func (dscu *DocServerCallbackUpdate) SetCurrNum(i int32) *DocServerCallbackUpdate {
	dscu.mutation.ResetCurrNum()
	dscu.mutation.SetCurrNum(i)
	return dscu
}

// SetNillableCurrNum sets the "curr_num" field if the given value is not nil.
func (dscu *DocServerCallbackUpdate) SetNillableCurrNum(i *int32) *DocServerCallbackUpdate {
	if i != nil {
		dscu.SetCurrNum(*i)
	}
	return dscu
}

// AddCurrNum adds i to the "curr_num" field.
func (dscu *DocServerCallbackUpdate) AddCurrNum(i int32) *DocServerCallbackUpdate {
	dscu.mutation.AddCurrNum(i)
	return dscu
}

// SetCreatedAt sets the "created_at" field.
func (dscu *DocServerCallbackUpdate) SetCreatedAt(t time.Time) *DocServerCallbackUpdate {
	dscu.mutation.SetCreatedAt(t)
	return dscu
}

// SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (dscu *DocServerCallbackUpdate) SetNillableCreatedAt(t *time.Time) *DocServerCallbackUpdate {
	if t != nil {
		dscu.SetCreatedAt(*t)
	}
	return dscu
}

// ClearCreatedAt clears the value of the "created_at" field.
func (dscu *DocServerCallbackUpdate) ClearCreatedAt() *DocServerCallbackUpdate {
	dscu.mutation.ClearCreatedAt()
	return dscu
}

// SetUpdatedAt sets the "updated_at" field.
func (dscu *DocServerCallbackUpdate) SetUpdatedAt(t time.Time) *DocServerCallbackUpdate {
	dscu.mutation.SetUpdatedAt(t)
	return dscu
}

// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (dscu *DocServerCallbackUpdate) SetNillableUpdatedAt(t *time.Time) *DocServerCallbackUpdate {
	if t != nil {
		dscu.SetUpdatedAt(*t)
	}
	return dscu
}

// ClearUpdatedAt clears the value of the "updated_at" field.
func (dscu *DocServerCallbackUpdate) ClearUpdatedAt() *DocServerCallbackUpdate {
	dscu.mutation.ClearUpdatedAt()
	return dscu
}

// SetDeletedAt sets the "deleted_at" field.
func (dscu *DocServerCallbackUpdate) SetDeletedAt(t time.Time) *DocServerCallbackUpdate {
	dscu.mutation.SetDeletedAt(t)
	return dscu
}

// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (dscu *DocServerCallbackUpdate) SetNillableDeletedAt(t *time.Time) *DocServerCallbackUpdate {
	if t != nil {
		dscu.SetDeletedAt(*t)
	}
	return dscu
}

// ClearDeletedAt clears the value of the "deleted_at" field.
func (dscu *DocServerCallbackUpdate) ClearDeletedAt() *DocServerCallbackUpdate {
	dscu.mutation.ClearDeletedAt()
	return dscu
}

// Mutation returns the DocServerCallbackMutation object of the builder.
func (dscu *DocServerCallbackUpdate) Mutation() *DocServerCallbackMutation {
	return dscu.mutation
}

// Save executes the query and returns the number of nodes affected by the update operation.
func (dscu *DocServerCallbackUpdate) Save(ctx context.Context) (int, error) {
	return withHooks(ctx, dscu.sqlSave, dscu.mutation, dscu.hooks)
}

// SaveX is like Save, but panics if an error occurs.
func (dscu *DocServerCallbackUpdate) SaveX(ctx context.Context) int {
	affected, err := dscu.Save(ctx)
	if err != nil {
		panic(err)
	}
	return affected
}

// Exec executes the query.
func (dscu *DocServerCallbackUpdate) Exec(ctx context.Context) error {
	_, err := dscu.Save(ctx)
	return err
}

// ExecX is like Exec, but panics if an error occurs.
func (dscu *DocServerCallbackUpdate) ExecX(ctx context.Context) {
	if err := dscu.Exec(ctx); err != nil {
		panic(err)
	}
}

func (dscu *DocServerCallbackUpdate) sqlSave(ctx context.Context) (n int, err error) {
	_spec := sqlgraph.NewUpdateSpec(docservercallback.Table, docservercallback.Columns, sqlgraph.NewFieldSpec(docservercallback.FieldID, field.TypeInt32))
	if ps := dscu.mutation.predicates; len(ps) > 0 {
		_spec.Predicate = func(selector *sql.Selector) {
			for i := range ps {
				ps[i](selector)
			}
		}
	}
	if value, ok := dscu.mutation.ServerProjectID(); ok {
		_spec.SetField(docservercallback.FieldServerProjectID, field.TypeInt32, value)
	}
	if value, ok := dscu.mutation.AddedServerProjectID(); ok {
		_spec.AddField(docservercallback.FieldServerProjectID, field.TypeInt32, value)
	}
	if value, ok := dscu.mutation.CallbackURL(); ok {
		_spec.SetField(docservercallback.FieldCallbackURL, field.TypeString, value)
	}
	if value, ok := dscu.mutation.CallbackData(); ok {
		_spec.SetField(docservercallback.FieldCallbackData, field.TypeString, value)
	}
	if value, ok := dscu.mutation.CallbackType(); ok {
		_spec.SetField(docservercallback.FieldCallbackType, field.TypeInt8, value)
	}
	if value, ok := dscu.mutation.AddedCallbackType(); ok {
		_spec.AddField(docservercallback.FieldCallbackType, field.TypeInt8, value)
	}
	if value, ok := dscu.mutation.Status(); ok {
		_spec.SetField(docservercallback.FieldStatus, field.TypeInt8, value)
	}
	if value, ok := dscu.mutation.AddedStatus(); ok {
		_spec.AddField(docservercallback.FieldStatus, field.TypeInt8, value)
	}
	if value, ok := dscu.mutation.CurrNum(); ok {
		_spec.SetField(docservercallback.FieldCurrNum, field.TypeInt32, value)
	}
	if value, ok := dscu.mutation.AddedCurrNum(); ok {
		_spec.AddField(docservercallback.FieldCurrNum, field.TypeInt32, value)
	}
	if value, ok := dscu.mutation.CreatedAt(); ok {
		_spec.SetField(docservercallback.FieldCreatedAt, field.TypeTime, value)
	}
	if dscu.mutation.CreatedAtCleared() {
		_spec.ClearField(docservercallback.FieldCreatedAt, field.TypeTime)
	}
	if value, ok := dscu.mutation.UpdatedAt(); ok {
		_spec.SetField(docservercallback.FieldUpdatedAt, field.TypeTime, value)
	}
	if dscu.mutation.UpdatedAtCleared() {
		_spec.ClearField(docservercallback.FieldUpdatedAt, field.TypeTime)
	}
	if value, ok := dscu.mutation.DeletedAt(); ok {
		_spec.SetField(docservercallback.FieldDeletedAt, field.TypeTime, value)
	}
	if dscu.mutation.DeletedAtCleared() {
		_spec.ClearField(docservercallback.FieldDeletedAt, field.TypeTime)
	}
	if n, err = sqlgraph.UpdateNodes(ctx, dscu.driver, _spec); err != nil {
		if _, ok := err.(*sqlgraph.NotFoundError); ok {
			err = &NotFoundError{docservercallback.Label}
		} else if sqlgraph.IsConstraintError(err) {
			err = &ConstraintError{msg: err.Error(), wrap: err}
		}
		return 0, err
	}
	dscu.mutation.done = true
	return n, nil
}

// DocServerCallbackUpdateOne is the builder for updating a single DocServerCallback entity.
type DocServerCallbackUpdateOne struct {
	config
	fields   []string
	hooks    []Hook
	mutation *DocServerCallbackMutation
}

// SetServerProjectID sets the "server_project_id" field.
func (dscuo *DocServerCallbackUpdateOne) SetServerProjectID(i int32) *DocServerCallbackUpdateOne {
	dscuo.mutation.ResetServerProjectID()
	dscuo.mutation.SetServerProjectID(i)
	return dscuo
}

// SetNillableServerProjectID sets the "server_project_id" field if the given value is not nil.
func (dscuo *DocServerCallbackUpdateOne) SetNillableServerProjectID(i *int32) *DocServerCallbackUpdateOne {
	if i != nil {
		dscuo.SetServerProjectID(*i)
	}
	return dscuo
}

// AddServerProjectID adds i to the "server_project_id" field.
func (dscuo *DocServerCallbackUpdateOne) AddServerProjectID(i int32) *DocServerCallbackUpdateOne {
	dscuo.mutation.AddServerProjectID(i)
	return dscuo
}

// SetCallbackURL sets the "callback_url" field.
func (dscuo *DocServerCallbackUpdateOne) SetCallbackURL(s string) *DocServerCallbackUpdateOne {
	dscuo.mutation.SetCallbackURL(s)
	return dscuo
}

// SetNillableCallbackURL sets the "callback_url" field if the given value is not nil.
func (dscuo *DocServerCallbackUpdateOne) SetNillableCallbackURL(s *string) *DocServerCallbackUpdateOne {
	if s != nil {
		dscuo.SetCallbackURL(*s)
	}
	return dscuo
}

// SetCallbackData sets the "callback_data" field.
func (dscuo *DocServerCallbackUpdateOne) SetCallbackData(s string) *DocServerCallbackUpdateOne {
	dscuo.mutation.SetCallbackData(s)
	return dscuo
}

// SetNillableCallbackData sets the "callback_data" field if the given value is not nil.
func (dscuo *DocServerCallbackUpdateOne) SetNillableCallbackData(s *string) *DocServerCallbackUpdateOne {
	if s != nil {
		dscuo.SetCallbackData(*s)
	}
	return dscuo
}

// SetCallbackType sets the "callback_type" field.
func (dscuo *DocServerCallbackUpdateOne) SetCallbackType(i int8) *DocServerCallbackUpdateOne {
	dscuo.mutation.ResetCallbackType()
	dscuo.mutation.SetCallbackType(i)
	return dscuo
}

// SetNillableCallbackType sets the "callback_type" field if the given value is not nil.
func (dscuo *DocServerCallbackUpdateOne) SetNillableCallbackType(i *int8) *DocServerCallbackUpdateOne {
	if i != nil {
		dscuo.SetCallbackType(*i)
	}
	return dscuo
}

// AddCallbackType adds i to the "callback_type" field.
func (dscuo *DocServerCallbackUpdateOne) AddCallbackType(i int8) *DocServerCallbackUpdateOne {
	dscuo.mutation.AddCallbackType(i)
	return dscuo
}

// SetStatus sets the "status" field.
func (dscuo *DocServerCallbackUpdateOne) SetStatus(i int8) *DocServerCallbackUpdateOne {
	dscuo.mutation.ResetStatus()
	dscuo.mutation.SetStatus(i)
	return dscuo
}

// SetNillableStatus sets the "status" field if the given value is not nil.
func (dscuo *DocServerCallbackUpdateOne) SetNillableStatus(i *int8) *DocServerCallbackUpdateOne {
	if i != nil {
		dscuo.SetStatus(*i)
	}
	return dscuo
}

// AddStatus adds i to the "status" field.
func (dscuo *DocServerCallbackUpdateOne) AddStatus(i int8) *DocServerCallbackUpdateOne {
	dscuo.mutation.AddStatus(i)
	return dscuo
}

// SetCurrNum sets the "curr_num" field.
func (dscuo *DocServerCallbackUpdateOne) SetCurrNum(i int32) *DocServerCallbackUpdateOne {
	dscuo.mutation.ResetCurrNum()
	dscuo.mutation.SetCurrNum(i)
	return dscuo
}

// SetNillableCurrNum sets the "curr_num" field if the given value is not nil.
func (dscuo *DocServerCallbackUpdateOne) SetNillableCurrNum(i *int32) *DocServerCallbackUpdateOne {
	if i != nil {
		dscuo.SetCurrNum(*i)
	}
	return dscuo
}

// AddCurrNum adds i to the "curr_num" field.
func (dscuo *DocServerCallbackUpdateOne) AddCurrNum(i int32) *DocServerCallbackUpdateOne {
	dscuo.mutation.AddCurrNum(i)
	return dscuo
}

// SetCreatedAt sets the "created_at" field.
func (dscuo *DocServerCallbackUpdateOne) SetCreatedAt(t time.Time) *DocServerCallbackUpdateOne {
	dscuo.mutation.SetCreatedAt(t)
	return dscuo
}

// SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (dscuo *DocServerCallbackUpdateOne) SetNillableCreatedAt(t *time.Time) *DocServerCallbackUpdateOne {
	if t != nil {
		dscuo.SetCreatedAt(*t)
	}
	return dscuo
}

// ClearCreatedAt clears the value of the "created_at" field.
func (dscuo *DocServerCallbackUpdateOne) ClearCreatedAt() *DocServerCallbackUpdateOne {
	dscuo.mutation.ClearCreatedAt()
	return dscuo
}

// SetUpdatedAt sets the "updated_at" field.
func (dscuo *DocServerCallbackUpdateOne) SetUpdatedAt(t time.Time) *DocServerCallbackUpdateOne {
	dscuo.mutation.SetUpdatedAt(t)
	return dscuo
}

// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (dscuo *DocServerCallbackUpdateOne) SetNillableUpdatedAt(t *time.Time) *DocServerCallbackUpdateOne {
	if t != nil {
		dscuo.SetUpdatedAt(*t)
	}
	return dscuo
}

// ClearUpdatedAt clears the value of the "updated_at" field.
func (dscuo *DocServerCallbackUpdateOne) ClearUpdatedAt() *DocServerCallbackUpdateOne {
	dscuo.mutation.ClearUpdatedAt()
	return dscuo
}

// SetDeletedAt sets the "deleted_at" field.
func (dscuo *DocServerCallbackUpdateOne) SetDeletedAt(t time.Time) *DocServerCallbackUpdateOne {
	dscuo.mutation.SetDeletedAt(t)
	return dscuo
}

// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (dscuo *DocServerCallbackUpdateOne) SetNillableDeletedAt(t *time.Time) *DocServerCallbackUpdateOne {
	if t != nil {
		dscuo.SetDeletedAt(*t)
	}
	return dscuo
}

// ClearDeletedAt clears the value of the "deleted_at" field.
func (dscuo *DocServerCallbackUpdateOne) ClearDeletedAt() *DocServerCallbackUpdateOne {
	dscuo.mutation.ClearDeletedAt()
	return dscuo
}

// Mutation returns the DocServerCallbackMutation object of the builder.
func (dscuo *DocServerCallbackUpdateOne) Mutation() *DocServerCallbackMutation {
	return dscuo.mutation
}

// Where appends a list predicates to the DocServerCallbackUpdate builder.
func (dscuo *DocServerCallbackUpdateOne) Where(ps ...predicate.DocServerCallback) *DocServerCallbackUpdateOne {
	dscuo.mutation.Where(ps...)
	return dscuo
}

// Select allows selecting one or more fields (columns) of the returned entity.
// The default is selecting all fields defined in the entity schema.
func (dscuo *DocServerCallbackUpdateOne) Select(field string, fields ...string) *DocServerCallbackUpdateOne {
	dscuo.fields = append([]string{field}, fields...)
	return dscuo
}

// Save executes the query and returns the updated DocServerCallback entity.
func (dscuo *DocServerCallbackUpdateOne) Save(ctx context.Context) (*DocServerCallback, error) {
	return withHooks(ctx, dscuo.sqlSave, dscuo.mutation, dscuo.hooks)
}

// SaveX is like Save, but panics if an error occurs.
func (dscuo *DocServerCallbackUpdateOne) SaveX(ctx context.Context) *DocServerCallback {
	node, err := dscuo.Save(ctx)
	if err != nil {
		panic(err)
	}
	return node
}

// Exec executes the query on the entity.
func (dscuo *DocServerCallbackUpdateOne) Exec(ctx context.Context) error {
	_, err := dscuo.Save(ctx)
	return err
}

// ExecX is like Exec, but panics if an error occurs.
func (dscuo *DocServerCallbackUpdateOne) ExecX(ctx context.Context) {
	if err := dscuo.Exec(ctx); err != nil {
		panic(err)
	}
}

func (dscuo *DocServerCallbackUpdateOne) sqlSave(ctx context.Context) (_node *DocServerCallback, err error) {
	_spec := sqlgraph.NewUpdateSpec(docservercallback.Table, docservercallback.Columns, sqlgraph.NewFieldSpec(docservercallback.FieldID, field.TypeInt32))
	id, ok := dscuo.mutation.ID()
	if !ok {
		return nil, &ValidationError{Name: "id", err: errors.New(`serversitemicros: missing "DocServerCallback.id" for update`)}
	}
	_spec.Node.ID.Value = id
	if fields := dscuo.fields; len(fields) > 0 {
		_spec.Node.Columns = make([]string, 0, len(fields))
		_spec.Node.Columns = append(_spec.Node.Columns, docservercallback.FieldID)
		for _, f := range fields {
			if !docservercallback.ValidColumn(f) {
				return nil, &ValidationError{Name: f, err: fmt.Errorf("serversitemicros: invalid field %q for query", f)}
			}
			if f != docservercallback.FieldID {
				_spec.Node.Columns = append(_spec.Node.Columns, f)
			}
		}
	}
	if ps := dscuo.mutation.predicates; len(ps) > 0 {
		_spec.Predicate = func(selector *sql.Selector) {
			for i := range ps {
				ps[i](selector)
			}
		}
	}
	if value, ok := dscuo.mutation.ServerProjectID(); ok {
		_spec.SetField(docservercallback.FieldServerProjectID, field.TypeInt32, value)
	}
	if value, ok := dscuo.mutation.AddedServerProjectID(); ok {
		_spec.AddField(docservercallback.FieldServerProjectID, field.TypeInt32, value)
	}
	if value, ok := dscuo.mutation.CallbackURL(); ok {
		_spec.SetField(docservercallback.FieldCallbackURL, field.TypeString, value)
	}
	if value, ok := dscuo.mutation.CallbackData(); ok {
		_spec.SetField(docservercallback.FieldCallbackData, field.TypeString, value)
	}
	if value, ok := dscuo.mutation.CallbackType(); ok {
		_spec.SetField(docservercallback.FieldCallbackType, field.TypeInt8, value)
	}
	if value, ok := dscuo.mutation.AddedCallbackType(); ok {
		_spec.AddField(docservercallback.FieldCallbackType, field.TypeInt8, value)
	}
	if value, ok := dscuo.mutation.Status(); ok {
		_spec.SetField(docservercallback.FieldStatus, field.TypeInt8, value)
	}
	if value, ok := dscuo.mutation.AddedStatus(); ok {
		_spec.AddField(docservercallback.FieldStatus, field.TypeInt8, value)
	}
	if value, ok := dscuo.mutation.CurrNum(); ok {
		_spec.SetField(docservercallback.FieldCurrNum, field.TypeInt32, value)
	}
	if value, ok := dscuo.mutation.AddedCurrNum(); ok {
		_spec.AddField(docservercallback.FieldCurrNum, field.TypeInt32, value)
	}
	if value, ok := dscuo.mutation.CreatedAt(); ok {
		_spec.SetField(docservercallback.FieldCreatedAt, field.TypeTime, value)
	}
	if dscuo.mutation.CreatedAtCleared() {
		_spec.ClearField(docservercallback.FieldCreatedAt, field.TypeTime)
	}
	if value, ok := dscuo.mutation.UpdatedAt(); ok {
		_spec.SetField(docservercallback.FieldUpdatedAt, field.TypeTime, value)
	}
	if dscuo.mutation.UpdatedAtCleared() {
		_spec.ClearField(docservercallback.FieldUpdatedAt, field.TypeTime)
	}
	if value, ok := dscuo.mutation.DeletedAt(); ok {
		_spec.SetField(docservercallback.FieldDeletedAt, field.TypeTime, value)
	}
	if dscuo.mutation.DeletedAtCleared() {
		_spec.ClearField(docservercallback.FieldDeletedAt, field.TypeTime)
	}
	_node = &DocServerCallback{config: dscuo.config}
	_spec.Assign = _node.assignValues
	_spec.ScanValues = _node.scanValues
	if err = sqlgraph.UpdateNode(ctx, dscuo.driver, _spec); err != nil {
		if _, ok := err.(*sqlgraph.NotFoundError); ok {
			err = &NotFoundError{docservercallback.Label}
		} else if sqlgraph.IsConstraintError(err) {
			err = &ConstraintError{msg: err.Error(), wrap: err}
		}
		return nil, err
	}
	dscuo.mutation.done = true
	return _node, nil
}
