listHarvestJobs method
Retrieves a list of harvest jobs that match the specified criteria.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter channelGroupName :
The name of the channel group to filter the harvest jobs by. If specified,
only harvest jobs associated with channels in this group will be returned.
Parameter channelName :
The name of the channel to filter the harvest jobs by. If specified, only
harvest jobs associated with this channel will be returned.
Parameter maxResults :
The maximum number of harvest jobs to return in a single request. If not
specified, a default value will be used.
Parameter nextToken :
A token used for pagination. Provide this value in subsequent requests to
retrieve the next set of results.
Parameter originEndpointName :
The name of the origin endpoint to filter the harvest jobs by. If
specified, only harvest jobs associated with this origin endpoint will be
returned.
Parameter status :
The status to filter the harvest jobs by. If specified, only harvest jobs
with this status will be returned.
Implementation
Future<ListHarvestJobsResponse> listHarvestJobs({
required String channelGroupName,
String? channelName,
int? maxResults,
String? nextToken,
String? originEndpointName,
HarvestJobStatus? status,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
100,
);
final $query = <String, List<String>>{
if (channelName != null) 'channelName': [channelName],
if (maxResults != null) 'maxResults': [maxResults.toString()],
if (nextToken != null) 'nextToken': [nextToken],
if (originEndpointName != null)
'originEndpointName': [originEndpointName],
if (status != null) 'includeStatus': [status.value],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri:
'/channelGroup/${Uri.encodeComponent(channelGroupName)}/harvestJob',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListHarvestJobsResponse.fromJson(response);
}