postLinkDevicesByMachineRevoke method
Logs out every account on one machine and stops its sessions.
Logs out every account on one machine and stops its sessions. It revokes every one of the caller's accounts on one machine and stops the agent sessions they were running, answering with how many of each. This is the "I lost that laptop" button. Revoked links are RETAINED, not deleted, so usage history and the audit trail survive a log-out — the rows come back in the response with their new status. The session stop reaches only the REVOKING user's own sessions, so a shared machine name can never be used to stop a co-tenant's work, and a stop that fails does not fail the revoke: the revoked row is the durable truth and the count then honestly reports fewer. A machine with nothing left to revoke is 404.
Parameters:
- String machine (required): Machine is the machine to act on, from the path. It is scoped to the caller, so a machine with none of the caller's accounts is a 404.
Implementation
Future<RevokeResp?> postLinkDevicesByMachineRevoke(String machine,) async {
final response = await postLinkDevicesByMachineRevokeWithHttpInfo(machine,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'RevokeResp',) as RevokeResp;
}
return null;
}