cancelHarvestJob method

Future<void> cancelHarvestJob({
  1. required String channelGroupName,
  2. required String channelName,
  3. required String harvestJobName,
  4. required String originEndpointName,
  5. String? eTag,
})

Cancels an in-progress harvest job.

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

Parameter channelGroupName : The name of the channel group containing the channel from which the harvest job is running.

Parameter channelName : The name of the channel from which the harvest job is running.

Parameter harvestJobName : The name of the harvest job to cancel. This name must be unique within the channel and cannot be changed after the harvest job is submitted.

Parameter originEndpointName : The name of the origin endpoint that the harvest job is harvesting from. This cannot be changed after the harvest job is submitted.

Parameter eTag : The current Entity Tag (ETag) associated with the harvest job. Used for concurrency control.

Implementation

Future<void> cancelHarvestJob({
  required String channelGroupName,
  required String channelName,
  required String harvestJobName,
  required String originEndpointName,
  String? eTag,
}) async {
  final headers = <String, String>{
    if (eTag != null) 'x-amzn-update-if-match': eTag.toString(),
  };
  final response = await _protocol.send(
    payload: null,
    method: 'PUT',
    requestUri:
        '/channelGroup/${Uri.encodeComponent(channelGroupName)}/channel/${Uri.encodeComponent(channelName)}/originEndpoint/${Uri.encodeComponent(originEndpointName)}/harvestJob/${Uri.encodeComponent(harvestJobName)}',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
}