mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: make generated client to implement the ent.Mutator interface (#3161)
This commit is contained in:
@@ -243,6 +243,48 @@ func (c *Client) Use(hooks ...Hook) {
|
||||
c.User.Use(hooks...)
|
||||
}
|
||||
|
||||
// Mutate implements the ent.Mutator interface.
|
||||
func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error) {
|
||||
switch m := m.(type) {
|
||||
case *AccountMutation:
|
||||
return c.Account.mutate(ctx, m)
|
||||
case *BlobMutation:
|
||||
return c.Blob.mutate(ctx, m)
|
||||
case *BlobLinkMutation:
|
||||
return c.BlobLink.mutate(ctx, m)
|
||||
case *CarMutation:
|
||||
return c.Car.mutate(ctx, m)
|
||||
case *DeviceMutation:
|
||||
return c.Device.mutate(ctx, m)
|
||||
case *DocMutation:
|
||||
return c.Doc.mutate(ctx, m)
|
||||
case *GroupMutation:
|
||||
return c.Group.mutate(ctx, m)
|
||||
case *IntSIDMutation:
|
||||
return c.IntSID.mutate(ctx, m)
|
||||
case *LinkMutation:
|
||||
return c.Link.mutate(ctx, m)
|
||||
case *MixinIDMutation:
|
||||
return c.MixinID.mutate(ctx, m)
|
||||
case *NoteMutation:
|
||||
return c.Note.mutate(ctx, m)
|
||||
case *OtherMutation:
|
||||
return c.Other.mutate(ctx, m)
|
||||
case *PetMutation:
|
||||
return c.Pet.mutate(ctx, m)
|
||||
case *RevisionMutation:
|
||||
return c.Revision.mutate(ctx, m)
|
||||
case *SessionMutation:
|
||||
return c.Session.mutate(ctx, m)
|
||||
case *TokenMutation:
|
||||
return c.Token.mutate(ctx, m)
|
||||
case *UserMutation:
|
||||
return c.User.mutate(ctx, m)
|
||||
default:
|
||||
return nil, fmt.Errorf("ent: unknown mutation type %T", m)
|
||||
}
|
||||
}
|
||||
|
||||
// AccountClient is a client for the Account schema.
|
||||
type AccountClient struct {
|
||||
config
|
||||
@@ -349,6 +391,21 @@ func (c *AccountClient) Hooks() []Hook {
|
||||
return c.hooks.Account
|
||||
}
|
||||
|
||||
func (c *AccountClient) mutate(ctx context.Context, m *AccountMutation) (Value, error) {
|
||||
switch m.Op() {
|
||||
case OpCreate:
|
||||
return (&AccountCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdate:
|
||||
return (&AccountUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdateOne:
|
||||
return (&AccountUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpDelete, OpDeleteOne:
|
||||
return (&AccountDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
|
||||
default:
|
||||
return nil, fmt.Errorf("ent: unknown Account mutation op: %q", m.Op())
|
||||
}
|
||||
}
|
||||
|
||||
// BlobClient is a client for the Blob schema.
|
||||
type BlobClient struct {
|
||||
config
|
||||
@@ -487,6 +544,21 @@ func (c *BlobClient) Hooks() []Hook {
|
||||
return c.hooks.Blob
|
||||
}
|
||||
|
||||
func (c *BlobClient) mutate(ctx context.Context, m *BlobMutation) (Value, error) {
|
||||
switch m.Op() {
|
||||
case OpCreate:
|
||||
return (&BlobCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdate:
|
||||
return (&BlobUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdateOne:
|
||||
return (&BlobUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpDelete, OpDeleteOne:
|
||||
return (&BlobDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
|
||||
default:
|
||||
return nil, fmt.Errorf("ent: unknown Blob mutation op: %q", m.Op())
|
||||
}
|
||||
}
|
||||
|
||||
// BlobLinkClient is a client for the BlobLink schema.
|
||||
type BlobLinkClient struct {
|
||||
config
|
||||
@@ -560,6 +632,21 @@ func (c *BlobLinkClient) Hooks() []Hook {
|
||||
return c.hooks.BlobLink
|
||||
}
|
||||
|
||||
func (c *BlobLinkClient) mutate(ctx context.Context, m *BlobLinkMutation) (Value, error) {
|
||||
switch m.Op() {
|
||||
case OpCreate:
|
||||
return (&BlobLinkCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdate:
|
||||
return (&BlobLinkUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdateOne:
|
||||
return (&BlobLinkUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpDelete, OpDeleteOne:
|
||||
return (&BlobLinkDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
|
||||
default:
|
||||
return nil, fmt.Errorf("ent: unknown BlobLink mutation op: %q", m.Op())
|
||||
}
|
||||
}
|
||||
|
||||
// CarClient is a client for the Car schema.
|
||||
type CarClient struct {
|
||||
config
|
||||
@@ -666,6 +753,21 @@ func (c *CarClient) Hooks() []Hook {
|
||||
return c.hooks.Car
|
||||
}
|
||||
|
||||
func (c *CarClient) mutate(ctx context.Context, m *CarMutation) (Value, error) {
|
||||
switch m.Op() {
|
||||
case OpCreate:
|
||||
return (&CarCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdate:
|
||||
return (&CarUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdateOne:
|
||||
return (&CarUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpDelete, OpDeleteOne:
|
||||
return (&CarDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
|
||||
default:
|
||||
return nil, fmt.Errorf("ent: unknown Car mutation op: %q", m.Op())
|
||||
}
|
||||
}
|
||||
|
||||
// DeviceClient is a client for the Device schema.
|
||||
type DeviceClient struct {
|
||||
config
|
||||
@@ -788,6 +890,21 @@ func (c *DeviceClient) Hooks() []Hook {
|
||||
return c.hooks.Device
|
||||
}
|
||||
|
||||
func (c *DeviceClient) mutate(ctx context.Context, m *DeviceMutation) (Value, error) {
|
||||
switch m.Op() {
|
||||
case OpCreate:
|
||||
return (&DeviceCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdate:
|
||||
return (&DeviceUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdateOne:
|
||||
return (&DeviceUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpDelete, OpDeleteOne:
|
||||
return (&DeviceDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
|
||||
default:
|
||||
return nil, fmt.Errorf("ent: unknown Device mutation op: %q", m.Op())
|
||||
}
|
||||
}
|
||||
|
||||
// DocClient is a client for the Doc schema.
|
||||
type DocClient struct {
|
||||
config
|
||||
@@ -926,6 +1043,21 @@ func (c *DocClient) Hooks() []Hook {
|
||||
return c.hooks.Doc
|
||||
}
|
||||
|
||||
func (c *DocClient) mutate(ctx context.Context, m *DocMutation) (Value, error) {
|
||||
switch m.Op() {
|
||||
case OpCreate:
|
||||
return (&DocCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdate:
|
||||
return (&DocUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdateOne:
|
||||
return (&DocUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpDelete, OpDeleteOne:
|
||||
return (&DocDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
|
||||
default:
|
||||
return nil, fmt.Errorf("ent: unknown Doc mutation op: %q", m.Op())
|
||||
}
|
||||
}
|
||||
|
||||
// GroupClient is a client for the Group schema.
|
||||
type GroupClient struct {
|
||||
config
|
||||
@@ -1032,6 +1164,21 @@ func (c *GroupClient) Hooks() []Hook {
|
||||
return c.hooks.Group
|
||||
}
|
||||
|
||||
func (c *GroupClient) mutate(ctx context.Context, m *GroupMutation) (Value, error) {
|
||||
switch m.Op() {
|
||||
case OpCreate:
|
||||
return (&GroupCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdate:
|
||||
return (&GroupUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdateOne:
|
||||
return (&GroupUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpDelete, OpDeleteOne:
|
||||
return (&GroupDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
|
||||
default:
|
||||
return nil, fmt.Errorf("ent: unknown Group mutation op: %q", m.Op())
|
||||
}
|
||||
}
|
||||
|
||||
// IntSIDClient is a client for the IntSID schema.
|
||||
type IntSIDClient struct {
|
||||
config
|
||||
@@ -1154,6 +1301,21 @@ func (c *IntSIDClient) Hooks() []Hook {
|
||||
return c.hooks.IntSID
|
||||
}
|
||||
|
||||
func (c *IntSIDClient) mutate(ctx context.Context, m *IntSIDMutation) (Value, error) {
|
||||
switch m.Op() {
|
||||
case OpCreate:
|
||||
return (&IntSIDCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdate:
|
||||
return (&IntSIDUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdateOne:
|
||||
return (&IntSIDUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpDelete, OpDeleteOne:
|
||||
return (&IntSIDDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
|
||||
default:
|
||||
return nil, fmt.Errorf("ent: unknown IntSID mutation op: %q", m.Op())
|
||||
}
|
||||
}
|
||||
|
||||
// LinkClient is a client for the Link schema.
|
||||
type LinkClient struct {
|
||||
config
|
||||
@@ -1244,6 +1406,21 @@ func (c *LinkClient) Hooks() []Hook {
|
||||
return c.hooks.Link
|
||||
}
|
||||
|
||||
func (c *LinkClient) mutate(ctx context.Context, m *LinkMutation) (Value, error) {
|
||||
switch m.Op() {
|
||||
case OpCreate:
|
||||
return (&LinkCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdate:
|
||||
return (&LinkUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdateOne:
|
||||
return (&LinkUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpDelete, OpDeleteOne:
|
||||
return (&LinkDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
|
||||
default:
|
||||
return nil, fmt.Errorf("ent: unknown Link mutation op: %q", m.Op())
|
||||
}
|
||||
}
|
||||
|
||||
// MixinIDClient is a client for the MixinID schema.
|
||||
type MixinIDClient struct {
|
||||
config
|
||||
@@ -1334,6 +1511,21 @@ func (c *MixinIDClient) Hooks() []Hook {
|
||||
return c.hooks.MixinID
|
||||
}
|
||||
|
||||
func (c *MixinIDClient) mutate(ctx context.Context, m *MixinIDMutation) (Value, error) {
|
||||
switch m.Op() {
|
||||
case OpCreate:
|
||||
return (&MixinIDCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdate:
|
||||
return (&MixinIDUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdateOne:
|
||||
return (&MixinIDUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpDelete, OpDeleteOne:
|
||||
return (&MixinIDDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
|
||||
default:
|
||||
return nil, fmt.Errorf("ent: unknown MixinID mutation op: %q", m.Op())
|
||||
}
|
||||
}
|
||||
|
||||
// NoteClient is a client for the Note schema.
|
||||
type NoteClient struct {
|
||||
config
|
||||
@@ -1456,6 +1648,21 @@ func (c *NoteClient) Hooks() []Hook {
|
||||
return c.hooks.Note
|
||||
}
|
||||
|
||||
func (c *NoteClient) mutate(ctx context.Context, m *NoteMutation) (Value, error) {
|
||||
switch m.Op() {
|
||||
case OpCreate:
|
||||
return (&NoteCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdate:
|
||||
return (&NoteUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdateOne:
|
||||
return (&NoteUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpDelete, OpDeleteOne:
|
||||
return (&NoteDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
|
||||
default:
|
||||
return nil, fmt.Errorf("ent: unknown Note mutation op: %q", m.Op())
|
||||
}
|
||||
}
|
||||
|
||||
// OtherClient is a client for the Other schema.
|
||||
type OtherClient struct {
|
||||
config
|
||||
@@ -1546,6 +1753,21 @@ func (c *OtherClient) Hooks() []Hook {
|
||||
return c.hooks.Other
|
||||
}
|
||||
|
||||
func (c *OtherClient) mutate(ctx context.Context, m *OtherMutation) (Value, error) {
|
||||
switch m.Op() {
|
||||
case OpCreate:
|
||||
return (&OtherCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdate:
|
||||
return (&OtherUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdateOne:
|
||||
return (&OtherUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpDelete, OpDeleteOne:
|
||||
return (&OtherDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
|
||||
default:
|
||||
return nil, fmt.Errorf("ent: unknown Other mutation op: %q", m.Op())
|
||||
}
|
||||
}
|
||||
|
||||
// PetClient is a client for the Pet schema.
|
||||
type PetClient struct {
|
||||
config
|
||||
@@ -1700,6 +1922,21 @@ func (c *PetClient) Hooks() []Hook {
|
||||
return c.hooks.Pet
|
||||
}
|
||||
|
||||
func (c *PetClient) mutate(ctx context.Context, m *PetMutation) (Value, error) {
|
||||
switch m.Op() {
|
||||
case OpCreate:
|
||||
return (&PetCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdate:
|
||||
return (&PetUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdateOne:
|
||||
return (&PetUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpDelete, OpDeleteOne:
|
||||
return (&PetDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
|
||||
default:
|
||||
return nil, fmt.Errorf("ent: unknown Pet mutation op: %q", m.Op())
|
||||
}
|
||||
}
|
||||
|
||||
// RevisionClient is a client for the Revision schema.
|
||||
type RevisionClient struct {
|
||||
config
|
||||
@@ -1790,6 +2027,21 @@ func (c *RevisionClient) Hooks() []Hook {
|
||||
return c.hooks.Revision
|
||||
}
|
||||
|
||||
func (c *RevisionClient) mutate(ctx context.Context, m *RevisionMutation) (Value, error) {
|
||||
switch m.Op() {
|
||||
case OpCreate:
|
||||
return (&RevisionCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdate:
|
||||
return (&RevisionUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdateOne:
|
||||
return (&RevisionUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpDelete, OpDeleteOne:
|
||||
return (&RevisionDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
|
||||
default:
|
||||
return nil, fmt.Errorf("ent: unknown Revision mutation op: %q", m.Op())
|
||||
}
|
||||
}
|
||||
|
||||
// SessionClient is a client for the Session schema.
|
||||
type SessionClient struct {
|
||||
config
|
||||
@@ -1896,6 +2148,21 @@ func (c *SessionClient) Hooks() []Hook {
|
||||
return c.hooks.Session
|
||||
}
|
||||
|
||||
func (c *SessionClient) mutate(ctx context.Context, m *SessionMutation) (Value, error) {
|
||||
switch m.Op() {
|
||||
case OpCreate:
|
||||
return (&SessionCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdate:
|
||||
return (&SessionUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdateOne:
|
||||
return (&SessionUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpDelete, OpDeleteOne:
|
||||
return (&SessionDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
|
||||
default:
|
||||
return nil, fmt.Errorf("ent: unknown Session mutation op: %q", m.Op())
|
||||
}
|
||||
}
|
||||
|
||||
// TokenClient is a client for the Token schema.
|
||||
type TokenClient struct {
|
||||
config
|
||||
@@ -2002,6 +2269,21 @@ func (c *TokenClient) Hooks() []Hook {
|
||||
return c.hooks.Token
|
||||
}
|
||||
|
||||
func (c *TokenClient) mutate(ctx context.Context, m *TokenMutation) (Value, error) {
|
||||
switch m.Op() {
|
||||
case OpCreate:
|
||||
return (&TokenCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdate:
|
||||
return (&TokenUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdateOne:
|
||||
return (&TokenUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpDelete, OpDeleteOne:
|
||||
return (&TokenDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
|
||||
default:
|
||||
return nil, fmt.Errorf("ent: unknown Token mutation op: %q", m.Op())
|
||||
}
|
||||
}
|
||||
|
||||
// UserClient is a client for the User schema.
|
||||
type UserClient struct {
|
||||
config
|
||||
@@ -2155,3 +2437,18 @@ func (c *UserClient) QueryPets(u *User) *PetQuery {
|
||||
func (c *UserClient) Hooks() []Hook {
|
||||
return c.hooks.User
|
||||
}
|
||||
|
||||
func (c *UserClient) mutate(ctx context.Context, m *UserMutation) (Value, error) {
|
||||
switch m.Op() {
|
||||
case OpCreate:
|
||||
return (&UserCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdate:
|
||||
return (&UserUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdateOne:
|
||||
return (&UserUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpDelete, OpDeleteOne:
|
||||
return (&UserDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
|
||||
default:
|
||||
return nil, fmt.Errorf("ent: unknown User mutation op: %q", m.Op())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,6 +285,11 @@ func (m *AccountMutation) Op() Op {
|
||||
return m.op
|
||||
}
|
||||
|
||||
// SetOp allows setting the mutation operation.
|
||||
func (m *AccountMutation) SetOp(op Op) {
|
||||
m.op = op
|
||||
}
|
||||
|
||||
// Type returns the node type of this mutation (Account).
|
||||
func (m *AccountMutation) Type() string {
|
||||
return m.typ
|
||||
@@ -794,6 +799,11 @@ func (m *BlobMutation) Op() Op {
|
||||
return m.op
|
||||
}
|
||||
|
||||
// SetOp allows setting the mutation operation.
|
||||
func (m *BlobMutation) SetOp(op Op) {
|
||||
m.op = op
|
||||
}
|
||||
|
||||
// Type returns the node type of this mutation (Blob).
|
||||
func (m *BlobMutation) Type() string {
|
||||
return m.typ
|
||||
@@ -1207,6 +1217,11 @@ func (m *BlobLinkMutation) Op() Op {
|
||||
return m.op
|
||||
}
|
||||
|
||||
// SetOp allows setting the mutation operation.
|
||||
func (m *BlobLinkMutation) SetOp(op Op) {
|
||||
m.op = op
|
||||
}
|
||||
|
||||
// Type returns the node type of this mutation (BlobLink).
|
||||
func (m *BlobLinkMutation) Type() string {
|
||||
return m.typ
|
||||
@@ -1779,6 +1794,11 @@ func (m *CarMutation) Op() Op {
|
||||
return m.op
|
||||
}
|
||||
|
||||
// SetOp allows setting the mutation operation.
|
||||
func (m *CarMutation) SetOp(op Op) {
|
||||
m.op = op
|
||||
}
|
||||
|
||||
// Type returns the node type of this mutation (Car).
|
||||
func (m *CarMutation) Type() string {
|
||||
return m.typ
|
||||
@@ -2259,6 +2279,11 @@ func (m *DeviceMutation) Op() Op {
|
||||
return m.op
|
||||
}
|
||||
|
||||
// SetOp allows setting the mutation operation.
|
||||
func (m *DeviceMutation) SetOp(op Op) {
|
||||
m.op = op
|
||||
}
|
||||
|
||||
// Type returns the node type of this mutation (Device).
|
||||
func (m *DeviceMutation) Type() string {
|
||||
return m.typ
|
||||
@@ -2773,6 +2798,11 @@ func (m *DocMutation) Op() Op {
|
||||
return m.op
|
||||
}
|
||||
|
||||
// SetOp allows setting the mutation operation.
|
||||
func (m *DocMutation) SetOp(op Op) {
|
||||
m.op = op
|
||||
}
|
||||
|
||||
// Type returns the node type of this mutation (Doc).
|
||||
func (m *DocMutation) Type() string {
|
||||
return m.typ
|
||||
@@ -3199,6 +3229,11 @@ func (m *GroupMutation) Op() Op {
|
||||
return m.op
|
||||
}
|
||||
|
||||
// SetOp allows setting the mutation operation.
|
||||
func (m *GroupMutation) SetOp(op Op) {
|
||||
m.op = op
|
||||
}
|
||||
|
||||
// Type returns the node type of this mutation (Group).
|
||||
func (m *GroupMutation) Type() string {
|
||||
return m.typ
|
||||
@@ -3588,6 +3623,11 @@ func (m *IntSIDMutation) Op() Op {
|
||||
return m.op
|
||||
}
|
||||
|
||||
// SetOp allows setting the mutation operation.
|
||||
func (m *IntSIDMutation) SetOp(op Op) {
|
||||
m.op = op
|
||||
}
|
||||
|
||||
// Type returns the node type of this mutation (IntSID).
|
||||
func (m *IntSIDMutation) Type() string {
|
||||
return m.typ
|
||||
@@ -3934,6 +3974,11 @@ func (m *LinkMutation) Op() Op {
|
||||
return m.op
|
||||
}
|
||||
|
||||
// SetOp allows setting the mutation operation.
|
||||
func (m *LinkMutation) SetOp(op Op) {
|
||||
m.op = op
|
||||
}
|
||||
|
||||
// Type returns the node type of this mutation (Link).
|
||||
func (m *LinkMutation) Type() string {
|
||||
return m.typ
|
||||
@@ -4288,6 +4333,11 @@ func (m *MixinIDMutation) Op() Op {
|
||||
return m.op
|
||||
}
|
||||
|
||||
// SetOp allows setting the mutation operation.
|
||||
func (m *MixinIDMutation) SetOp(op Op) {
|
||||
m.op = op
|
||||
}
|
||||
|
||||
// Type returns the node type of this mutation (MixinID).
|
||||
func (m *MixinIDMutation) Type() string {
|
||||
return m.typ
|
||||
@@ -4733,6 +4783,11 @@ func (m *NoteMutation) Op() Op {
|
||||
return m.op
|
||||
}
|
||||
|
||||
// SetOp allows setting the mutation operation.
|
||||
func (m *NoteMutation) SetOp(op Op) {
|
||||
m.op = op
|
||||
}
|
||||
|
||||
// Type returns the node type of this mutation (Note).
|
||||
func (m *NoteMutation) Type() string {
|
||||
return m.typ
|
||||
@@ -5076,6 +5131,11 @@ func (m *OtherMutation) Op() Op {
|
||||
return m.op
|
||||
}
|
||||
|
||||
// SetOp allows setting the mutation operation.
|
||||
func (m *OtherMutation) SetOp(op Op) {
|
||||
m.op = op
|
||||
}
|
||||
|
||||
// Type returns the node type of this mutation (Other).
|
||||
func (m *OtherMutation) Type() string {
|
||||
return m.typ
|
||||
@@ -5527,6 +5587,11 @@ func (m *PetMutation) Op() Op {
|
||||
return m.op
|
||||
}
|
||||
|
||||
// SetOp allows setting the mutation operation.
|
||||
func (m *PetMutation) SetOp(op Op) {
|
||||
m.op = op
|
||||
}
|
||||
|
||||
// Type returns the node type of this mutation (Pet).
|
||||
func (m *PetMutation) Type() string {
|
||||
return m.typ
|
||||
@@ -5880,6 +5945,11 @@ func (m *RevisionMutation) Op() Op {
|
||||
return m.op
|
||||
}
|
||||
|
||||
// SetOp allows setting the mutation operation.
|
||||
func (m *RevisionMutation) SetOp(op Op) {
|
||||
m.op = op
|
||||
}
|
||||
|
||||
// Type returns the node type of this mutation (Revision).
|
||||
func (m *RevisionMutation) Type() string {
|
||||
return m.typ
|
||||
@@ -6176,6 +6246,11 @@ func (m *SessionMutation) Op() Op {
|
||||
return m.op
|
||||
}
|
||||
|
||||
// SetOp allows setting the mutation operation.
|
||||
func (m *SessionMutation) SetOp(op Op) {
|
||||
m.op = op
|
||||
}
|
||||
|
||||
// Type returns the node type of this mutation (Session).
|
||||
func (m *SessionMutation) Type() string {
|
||||
return m.typ
|
||||
@@ -6535,6 +6610,11 @@ func (m *TokenMutation) Op() Op {
|
||||
return m.op
|
||||
}
|
||||
|
||||
// SetOp allows setting the mutation operation.
|
||||
func (m *TokenMutation) SetOp(op Op) {
|
||||
m.op = op
|
||||
}
|
||||
|
||||
// Type returns the node type of this mutation (Token).
|
||||
func (m *TokenMutation) Type() string {
|
||||
return m.typ
|
||||
@@ -7053,6 +7133,11 @@ func (m *UserMutation) Op() Op {
|
||||
return m.op
|
||||
}
|
||||
|
||||
// SetOp allows setting the mutation operation.
|
||||
func (m *UserMutation) SetOp(op Op) {
|
||||
m.op = op
|
||||
}
|
||||
|
||||
// Type returns the node type of this mutation (User).
|
||||
func (m *UserMutation) Type() string {
|
||||
return m.typ
|
||||
|
||||
Reference in New Issue
Block a user