| 1028 | } |
| 1029 | |
| 1030 | func (c *CASMappingClient) mutate(ctx context.Context, m *CASMappingMutation) (Value, error) { |
| 1031 | switch m.Op() { |
| 1032 | case OpCreate: |
| 1033 | return (&CASMappingCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) |
| 1034 | case OpUpdate: |
| 1035 | return (&CASMappingUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) |
| 1036 | case OpUpdateOne: |
| 1037 | return (&CASMappingUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) |
| 1038 | case OpDelete, OpDeleteOne: |
| 1039 | return (&CASMappingDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) |
| 1040 | default: |
| 1041 | return nil, fmt.Errorf("ent: unknown CASMapping mutation op: %q", m.Op()) |
| 1042 | } |
| 1043 | } |
| 1044 | |
| 1045 | // GroupClient is a client for the Group schema. |
| 1046 | type GroupClient struct { |