setAutoRecharge method
Implementation
Future<void> setAutoRecharge({
required String projectId,
required bool enabled,
required double amount,
required double threshold,
}) async {
final encodedProjectId = Uri.encodeComponent(projectId);
final uri = Uri.parse('$baseUrl/accounts/projects/$encodedProjectId/recharge');
final resp = await httpClient.post(uri, body: jsonEncode({"enabled": enabled, "amount": amount, "threshold": threshold}));
if (resp.statusCode != 200) {
throw Exception("Unable to update autorecharge");
}
}