| 116 | } |
| 117 | |
| 118 | func (c *Client) PatchWorkspaceProxy(ctx context.Context, req PatchWorkspaceProxy) (UpdateWorkspaceProxyResponse, error) { |
| 119 | res, err := c.Request(ctx, http.MethodPatch, |
| 120 | fmt.Sprintf("/api/v2/workspaceproxies/%s", req.ID.String()), |
| 121 | req, |
| 122 | ) |
| 123 | if err != nil { |
| 124 | return UpdateWorkspaceProxyResponse{}, xerrors.Errorf("make request: %w", err) |
| 125 | } |
| 126 | defer res.Body.Close() |
| 127 | |
| 128 | if res.StatusCode != http.StatusOK { |
| 129 | return UpdateWorkspaceProxyResponse{}, ReadBodyAsError(res) |
| 130 | } |
| 131 | var resp UpdateWorkspaceProxyResponse |
| 132 | return resp, json.NewDecoder(res.Body).Decode(&resp) |
| 133 | } |
| 134 | |
| 135 | func (c *Client) DeleteWorkspaceProxyByName(ctx context.Context, name string) error { |
| 136 | res, err := c.Request(ctx, http.MethodDelete, |