createPipeline method

Future<CreatePipelineResponse> createPipeline({
  1. required List<PipelineActivity> pipelineActivities,
  2. required String pipelineName,
  3. List<Tag>? tags,
})

Creates a pipeline. A pipeline consumes messages from a channel and allows you to process the messages before storing them in a data store. You must specify both a channel and a datastore activity and, optionally, as many as 23 additional activities in the pipelineActivities array.

May throw InvalidRequestException. May throw ResourceAlreadyExistsException. May throw InternalFailureException. May throw ServiceUnavailableException. May throw ThrottlingException. May throw LimitExceededException.

Parameter pipelineActivities : A list of PipelineActivity objects. Activities perform transformations on your messages, such as removing, renaming or adding message attributes; filtering messages based on attribute values; invoking your Lambda functions on messages for advanced processing; or performing mathematical transformations to normalize device data.

The list can be 2-25 PipelineActivity objects and must contain both a channel and a datastore activity. Each entry in the list must contain only one activity. For example:

pipelineActivities = { "channel": { ... } }, { "lambda": { ... } }, ...

Parameter pipelineName : The name of the pipeline.

Parameter tags : Metadata which can be used to manage the pipeline.

Implementation

Future<CreatePipelineResponse> createPipeline({
  required List<PipelineActivity> pipelineActivities,
  required String pipelineName,
  List<Tag>? tags,
}) async {
  ArgumentError.checkNotNull(pipelineActivities, 'pipelineActivities');
  ArgumentError.checkNotNull(pipelineName, 'pipelineName');
  _s.validateStringLength(
    'pipelineName',
    pipelineName,
    1,
    128,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    'pipelineActivities': pipelineActivities,
    'pipelineName': pipelineName,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/pipelines',
    exceptionFnMap: _exceptionFns,
  );
  return CreatePipelineResponse.fromJson(response);
}