| 190 | } |
| 191 | |
| 192 | func (c *Client) RemoveFromAllowlist(ctx context.Context, list *ent.AllowList, values ...string) (int, error) { |
| 193 | c.Log.Debugf("removing %d values from allowlist %s", len(values), list.Name) |
| 194 | c.Log.Tracef("values: %v", values) |
| 195 | |
| 196 | nbDeleted, err := c.Ent.AllowListItem.Delete().Where( |
| 197 | allowlistitem.HasAllowlistWith(allowlist.IDEQ(list.ID)), |
| 198 | allowlistitem.ValueIn(values...), |
| 199 | ).Exec(ctx) |
| 200 | if err != nil { |
| 201 | return 0, fmt.Errorf("unable to remove values from allowlist: %w", err) |
| 202 | } |
| 203 | |
| 204 | return nbDeleted, nil |
| 205 | } |
| 206 | |
| 207 | func (c *Client) UpdateAllowlistMeta(ctx context.Context, allowlistID string, name string, description string) error { |
| 208 | c.Log.Debugf("updating allowlist %s meta", name) |