(ctx context.Context, client *codersdk.Client, userID string)
| 1177 | } |
| 1178 | |
| 1179 | func deprecatedQuotaEndpoint(ctx context.Context, client *codersdk.Client, userID string) (codersdk.WorkspaceQuota, error) { |
| 1180 | res, err := client.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/workspace-quota/%s", userID), nil) |
| 1181 | if err != nil { |
| 1182 | return codersdk.WorkspaceQuota{}, err |
| 1183 | } |
| 1184 | defer res.Body.Close() |
| 1185 | if res.StatusCode != http.StatusOK { |
| 1186 | return codersdk.WorkspaceQuota{}, codersdk.ReadBodyAsError(res) |
| 1187 | } |
| 1188 | var quota codersdk.WorkspaceQuota |
| 1189 | return quota, json.NewDecoder(res.Body).Decode("a) |
| 1190 | } |
| 1191 | |
| 1192 | func planWithCost(cost int32) []*proto.Response { |
| 1193 | return []*proto.Response{{ |
no test coverage detected