listDatasetImportJobs method

Future<ListDatasetImportJobsResponse> listDatasetImportJobs({
  1. String? datasetArn,
  2. int? maxResults,
  3. String? nextToken,
})

Returns a list of dataset import jobs that use the given dataset. When a dataset is not specified, all the dataset import jobs associated with the account are listed. The response provides the properties for each dataset import job, including the Amazon Resource Name (ARN). For more information on dataset import jobs, see CreateDatasetImportJob. For more information on datasets, see CreateDataset.

May throw InvalidInputException. May throw InvalidNextTokenException.

Parameter datasetArn : The Amazon Resource Name (ARN) of the dataset to list the dataset import jobs for.

Parameter maxResults : The maximum number of dataset import jobs to return.

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

Implementation

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

  return ListDatasetImportJobsResponse.fromJson(jsonResponse.body);
}