authorize method
Authorize a mac for minutes.
up: upload speed in kbps
down: download speed in kbps
megabytes: data transfer limit in mb
ap_mac optional AP's mac
Throw ApiException if not successful
Implementation
Future<void> authorize(String mac, int minutes,
{int? up,
int? down,
int? megabytes,
String? ap_mac,
String? siteId}) async {
var payloads = {
'mac': mac,
'minutes': minutes,
'cmd': Commands.authorize,
};
if (up != null) payloads['up'] = up;
if (down != null) payloads['down'] = down;
if (megabytes != null) payloads['megabytes'] = megabytes;
await controller.post(Endpoints.staMgr, payloads, siteId: siteId);
}