| 90 | } |
| 91 | |
| 92 | func (c *Client) WorkspaceProxies(ctx context.Context) (RegionsResponse[WorkspaceProxy], error) { |
| 93 | res, err := c.Request(ctx, http.MethodGet, |
| 94 | "/api/v2/workspaceproxies", |
| 95 | nil, |
| 96 | ) |
| 97 | if err != nil { |
| 98 | return RegionsResponse[WorkspaceProxy]{}, xerrors.Errorf("make request: %w", err) |
| 99 | } |
| 100 | defer res.Body.Close() |
| 101 | |
| 102 | if res.StatusCode != http.StatusOK { |
| 103 | return RegionsResponse[WorkspaceProxy]{}, ReadBodyAsError(res) |
| 104 | } |
| 105 | |
| 106 | var proxies RegionsResponse[WorkspaceProxy] |
| 107 | return proxies, json.NewDecoder(res.Body).Decode(&proxies) |
| 108 | } |
| 109 | |
| 110 | type PatchWorkspaceProxy struct { |
| 111 | ID uuid.UUID `json:"id" format:"uuid" validate:"required"` |