listDataDeletionJobs method

Future<ListDataDeletionJobsResponse> listDataDeletionJobs({
  1. String? datasetGroupArn,
  2. int? maxResults,
  3. String? nextToken,
})

Returns a list of data deletion jobs for a dataset group ordered by creation time, with the most recent first. When a dataset group is not specified, all the data deletion jobs associated with the account are listed. The response provides the properties for each job, including the Amazon Resource Name (ARN). For more information on data deletion jobs, see Deleting users.

May throw InvalidInputException. May throw InvalidNextTokenException.

Parameter datasetGroupArn : The Amazon Resource Name (ARN) of the dataset group to list data deletion jobs for.

Parameter maxResults : The maximum number of data deletion jobs to return.

Parameter nextToken : A token returned from the previous call to ListDataDeletionJobs for getting the next set of jobs (if they exist).

Implementation

Future<ListDataDeletionJobsResponse> listDataDeletionJobs({
  String? datasetGroupArn,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonPersonalize.ListDataDeletionJobs'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (datasetGroupArn != null) 'datasetGroupArn': datasetGroupArn,
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return ListDataDeletionJobsResponse.fromJson(jsonResponse.body);
}