| 2327 | } |
| 2328 | |
| 2329 | func (c *OrganizationClient) mutate(ctx context.Context, m *OrganizationMutation) (Value, error) { |
| 2330 | switch m.Op() { |
| 2331 | case OpCreate: |
| 2332 | return (&OrganizationCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) |
| 2333 | case OpUpdate: |
| 2334 | return (&OrganizationUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) |
| 2335 | case OpUpdateOne: |
| 2336 | return (&OrganizationUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) |
| 2337 | case OpDelete, OpDeleteOne: |
| 2338 | return (&OrganizationDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) |
| 2339 | default: |
| 2340 | return nil, fmt.Errorf("ent: unknown Organization mutation op: %q", m.Op()) |
| 2341 | } |
| 2342 | } |
| 2343 | |
| 2344 | // ProjectClient is a client for the Project schema. |
| 2345 | type ProjectClient struct { |