| 1193 | } |
| 1194 | |
| 1195 | func (c *GroupClient) mutate(ctx context.Context, m *GroupMutation) (Value, error) { |
| 1196 | switch m.Op() { |
| 1197 | case OpCreate: |
| 1198 | return (&GroupCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) |
| 1199 | case OpUpdate: |
| 1200 | return (&GroupUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) |
| 1201 | case OpUpdateOne: |
| 1202 | return (&GroupUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) |
| 1203 | case OpDelete, OpDeleteOne: |
| 1204 | return (&GroupDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) |
| 1205 | default: |
| 1206 | return nil, fmt.Errorf("ent: unknown Group mutation op: %q", m.Op()) |
| 1207 | } |
| 1208 | } |
| 1209 | |
| 1210 | // GroupMembershipClient is a client for the GroupMembership schema. |
| 1211 | type GroupMembershipClient struct { |