listWorkgroups method

Future<ListWorkgroupsResponse> listWorkgroups({
  1. int? maxResults,
  2. String? nextToken,
  3. String? ownerAccount,
})

Returns information about a list of specified workgroups.

May throw InternalServerException. May throw ValidationException.

Parameter maxResults : An optional parameter that specifies the maximum number of results to return. You can use nextToken to display the next page of results.

Parameter nextToken : If your initial ListWorkgroups operation returns a nextToken, you can include the returned nextToken in following ListNamespaces operations, which returns results in the next page.

Parameter ownerAccount : The owner Amazon Web Services account for the Amazon Redshift Serverless workgroup.

Implementation

Future<ListWorkgroupsResponse> listWorkgroups({
  int? maxResults,
  String? nextToken,
  String? ownerAccount,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'RedshiftServerless.ListWorkgroups'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
      if (ownerAccount != null) 'ownerAccount': ownerAccount,
    },
  );

  return ListWorkgroupsResponse.fromJson(jsonResponse.body);
}