| 2508 | } |
| 2509 | |
| 2510 | func (c *ProjectClient) mutate(ctx context.Context, m *ProjectMutation) (Value, error) { |
| 2511 | switch m.Op() { |
| 2512 | case OpCreate: |
| 2513 | return (&ProjectCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) |
| 2514 | case OpUpdate: |
| 2515 | return (&ProjectUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) |
| 2516 | case OpUpdateOne: |
| 2517 | return (&ProjectUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) |
| 2518 | case OpDelete, OpDeleteOne: |
| 2519 | return (&ProjectDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) |
| 2520 | default: |
| 2521 | return nil, fmt.Errorf("ent: unknown Project mutation op: %q", m.Op()) |
| 2522 | } |
| 2523 | } |
| 2524 | |
| 2525 | // ProjectVersionClient is a client for the ProjectVersion schema. |
| 2526 | type ProjectVersionClient struct { |