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