deleteWorkspaceServiceAccount method

Future<DeleteWorkspaceServiceAccountResponse> deleteWorkspaceServiceAccount({
  1. required String serviceAccountId,
  2. required String workspaceId,
})

Deletes a workspace service account from the workspace.

This will delete any tokens created for the service account, as well. If the tokens are currently in use, the will fail to authenticate / authorize after they are deleted.

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 to delete.

Parameter workspaceId : The ID of the workspace where the service account resides.

Implementation

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