PutPrebuildsSettings modifies the prebuilds settings, which currently just controls whether all prebuild reconciliation is paused.
(ctx context.Context, settings PrebuildsSettings)
| 35 | // PutPrebuildsSettings modifies the prebuilds settings, which currently just controls whether all |
| 36 | // prebuild reconciliation is paused. |
| 37 | func (c *Client) PutPrebuildsSettings(ctx context.Context, settings PrebuildsSettings) error { |
| 38 | res, err := c.Request(ctx, http.MethodPut, "/api/v2/prebuilds/settings", settings) |
| 39 | if err != nil { |
| 40 | return err |
| 41 | } |
| 42 | defer res.Body.Close() |
| 43 | |
| 44 | if res.StatusCode == http.StatusNotModified { |
| 45 | return nil |
| 46 | } |
| 47 | if res.StatusCode != http.StatusOK { |
| 48 | return ReadBodyAsError(res) |
| 49 | } |
| 50 | return nil |
| 51 | } |