deleteLinkById method

Future<RevokeResp?> deleteLinkById(
  1. String id
)

Logs out one account and stops the sessions it was running.

Logs out one account and stops the sessions it was running. It revokes a single linked account and stops the agent sessions that ran under it, answering with the revoked row and how many sessions stopped. The link is RETAINED with a revoked status rather than deleted, so its usage history and the audit trail survive the log-out — which also means a revoked account still appears in the list, and is excluded from the route plan rather than absent from it. The session stop is narrowed to the revoking user's own sessions on that device, provider and account, and a stop that fails does not fail the revoke: the revoked row is the durable truth. An id that does not exist, or belongs to another user or org, is the same 404.

Parameters:

  • String id (required): ID is the link to act on, from the path. It is scoped to the caller, so another user's or org's id is a 404.

Implementation

Future<RevokeResp?> deleteLinkById(String id,) async {
  final response = await deleteLinkByIdWithHttpInfo(id,);
  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;
}