EditAPIKey replaces an API key at the given index.
(index int, newValue string)
| 266 | |
| 267 | // EditAPIKey replaces an API key at the given index. |
| 268 | func (c *Client) EditAPIKey(index int, newValue string) error { |
| 269 | body := map[string]any{"index": index, "value": newValue} |
| 270 | jsonBody, _ := json.Marshal(body) |
| 271 | _, err := c.patch("/v0/management/api-keys", strings.NewReader(string(jsonBody))) |
| 272 | return err |
| 273 | } |
| 274 | |
| 275 | // DeleteAPIKey deletes an API key by index. |
| 276 | func (c *Client) DeleteAPIKey(index int) error { |