listDataSourceSyncJobs method

Future<ListDataSourceSyncJobsResponse> listDataSourceSyncJobs({
  1. required String id,
  2. required String indexId,
  3. int? maxResults,
  4. String? nextToken,
  5. TimeRange? startTimeFilter,
  6. DataSourceSyncJobStatus? statusFilter,
})

Gets statistics about synchronizing Amazon Kendra with a data source.

May throw ValidationException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException.

Parameter id : The identifier of the data source.

Parameter indexId : The identifier of the index that contains the data source.

Parameter maxResults : The maximum number of synchronization jobs to return in the response. If there are fewer results in the list, this response contains only the actual results.

Parameter nextToken : If the result of the previous request to GetDataSourceSyncJobHistory was truncated, include the NextToken to fetch the next set of jobs.

Parameter startTimeFilter : When specified, the synchronization jobs returned in the list are limited to jobs between the specified dates.

Parameter statusFilter : When specified, only returns synchronization jobs with the Status field equal to the specified status.

Implementation

Future<ListDataSourceSyncJobsResponse> listDataSourceSyncJobs({
  required String id,
  required String indexId,
  int? maxResults,
  String? nextToken,
  TimeRange? startTimeFilter,
  DataSourceSyncJobStatus? statusFilter,
}) async {
  ArgumentError.checkNotNull(id, 'id');
  _s.validateStringLength(
    'id',
    id,
    1,
    100,
    isRequired: true,
  );
  ArgumentError.checkNotNull(indexId, 'indexId');
  _s.validateStringLength(
    'indexId',
    indexId,
    36,
    36,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    10,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    800,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSKendraFrontendService.ListDataSourceSyncJobs'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Id': id,
      'IndexId': indexId,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (startTimeFilter != null) 'StartTimeFilter': startTimeFilter,
      if (statusFilter != null) 'StatusFilter': statusFilter.toValue(),
    },
  );

  return ListDataSourceSyncJobsResponse.fromJson(jsonResponse.body);
}