MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / mutate

Method mutate

app/controlplane/pkg/data/ent/client.go:2329–2342  ·  view source on GitHub ↗
(ctx context.Context, m *OrganizationMutation)

Source from the content-addressed store, hash-verified

2327}
2328
2329func (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.
2345type ProjectClient struct {

Callers

nothing calls this directly

Calls 4

HooksMethod · 0.95
SaveMethod · 0.65
ExecMethod · 0.65
OpMethod · 0.45

Tested by

no test coverage detected