| 533 | } |
| 534 | |
| 535 | func (c *APITokenClient) mutate(ctx context.Context, m *APITokenMutation) (Value, error) { |
| 536 | switch m.Op() { |
| 537 | case OpCreate: |
| 538 | return (&APITokenCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) |
| 539 | case OpUpdate: |
| 540 | return (&APITokenUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) |
| 541 | case OpUpdateOne: |
| 542 | return (&APITokenUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) |
| 543 | case OpDelete, OpDeleteOne: |
| 544 | return (&APITokenDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) |
| 545 | default: |
| 546 | return nil, fmt.Errorf("ent: unknown APIToken mutation op: %q", m.Op()) |
| 547 | } |
| 548 | } |
| 549 | |
| 550 | // AttestationClient is a client for the Attestation schema. |
| 551 | type AttestationClient struct { |