deleteWorkspaceServiceAccountToken method

Future<DeleteWorkspaceServiceAccountTokenResponse> deleteWorkspaceServiceAccountToken({
  1. required String serviceAccountId,
  2. required String tokenId,
  3. required String workspaceId,
})

Deletes a token for the workspace service account.

This will disable the key associated with the token. If any automation is currently using the key, it will no longer be authenticated or authorized to perform actions with the Grafana HTTP APIs.

Service accounts are only available for workspaces that are compatible with Grafana version 9 and above.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter serviceAccountId : The ID of the service account from which to delete the token.

Parameter tokenId : The ID of the token to delete.

Parameter workspaceId : The ID of the workspace from which to delete the token.

Implementation

Future<DeleteWorkspaceServiceAccountTokenResponse>
    deleteWorkspaceServiceAccountToken({
  required String serviceAccountId,
  required String tokenId,
  required String workspaceId,
}) async {
  final response = await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri:
        '/workspaces/${Uri.encodeComponent(workspaceId)}/serviceaccounts/${Uri.encodeComponent(serviceAccountId)}/tokens/${Uri.encodeComponent(tokenId)}',
    exceptionFnMap: _exceptionFns,
  );
  return DeleteWorkspaceServiceAccountTokenResponse.fromJson(response);
}