| 3168 | } |
| 3169 | |
| 3170 | func (c *UserClient) mutate(ctx context.Context, m *UserMutation) (Value, error) { |
| 3171 | switch m.Op() { |
| 3172 | case OpCreate: |
| 3173 | return (&UserCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) |
| 3174 | case OpUpdate: |
| 3175 | return (&UserUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) |
| 3176 | case OpUpdateOne: |
| 3177 | return (&UserUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) |
| 3178 | case OpDelete, OpDeleteOne: |
| 3179 | return (&UserDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) |
| 3180 | default: |
| 3181 | return nil, fmt.Errorf("ent: unknown User mutation op: %q", m.Op()) |
| 3182 | } |
| 3183 | } |
| 3184 | |
| 3185 | // WorkflowClient is a client for the Workflow schema. |
| 3186 | type WorkflowClient struct { |