listWorkspaceServiceAccounts method
Returns a list of service accounts for a workspace.
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 workspaceId :
The workspace for which to list service accounts.
Parameter maxResults :
The maximum number of service accounts to include in the results.
Parameter nextToken :
The token for the next set of service accounts to return. (You receive
this token from a previous ListWorkspaceServiceAccounts
operation.)
Implementation
Future<ListWorkspaceServiceAccountsResponse> listWorkspaceServiceAccounts({
required String workspaceId,
int? maxResults,
String? nextToken,
}) async {
final $query = <String, List<String>>{
if (maxResults != null) 'maxResults': [maxResults.toString()],
if (nextToken != null) 'nextToken': [nextToken],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri:
'/workspaces/${Uri.encodeComponent(workspaceId)}/serviceaccounts',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListWorkspaceServiceAccountsResponse.fromJson(response);
}