runPipelineActivity method

Future<RunPipelineActivityResponse> runPipelineActivity({
  1. required List<Uint8List> payloads,
  2. required PipelineActivity pipelineActivity,
})

Simulates the results of running a pipeline activity on a message payload.

May throw InvalidRequestException. May throw InternalFailureException. May throw ServiceUnavailableException. May throw ThrottlingException.

Parameter payloads : The sample message payloads on which the pipeline activity is run.

Parameter pipelineActivity : The pipeline activity that is run. This must not be a channel activity or a datastore activity because these activities are used in a pipeline only to load the original message and to store the (possibly) transformed message. If a lambda activity is specified, only short-running Lambda functions (those with a timeout of less than 30 seconds or less) can be used.

Implementation

Future<RunPipelineActivityResponse> runPipelineActivity({
  required List<Uint8List> payloads,
  required PipelineActivity pipelineActivity,
}) async {
  ArgumentError.checkNotNull(payloads, 'payloads');
  ArgumentError.checkNotNull(pipelineActivity, 'pipelineActivity');
  final $payload = <String, dynamic>{
    'payloads': payloads.map(base64Encode).toList(),
    'pipelineActivity': pipelineActivity,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/pipelineactivities/run',
    exceptionFnMap: _exceptionFns,
  );
  return RunPipelineActivityResponse.fromJson(response);
}