getPipelineDefinition method

Future<GetPipelineDefinitionOutput> getPipelineDefinition({
  1. required String pipelineId,
  2. String? version,
})

Gets the definition of the specified pipeline. You can call GetPipelineDefinition to retrieve the pipeline definition that you provided using PutPipelineDefinition.

May throw InternalServiceError. May throw InvalidRequestException. May throw PipelineNotFoundException. May throw PipelineDeletedException.

Parameter pipelineId : The ID of the pipeline.

Parameter version : The version of the pipeline definition to retrieve. Set this parameter to latest (default) to use the last definition saved to the pipeline or active to use the last definition that was activated.

Implementation

Future<GetPipelineDefinitionOutput> getPipelineDefinition({
  required String pipelineId,
  String? version,
}) async {
  ArgumentError.checkNotNull(pipelineId, 'pipelineId');
  _s.validateStringLength(
    'pipelineId',
    pipelineId,
    1,
    1024,
    isRequired: true,
  );
  _s.validateStringLength(
    'version',
    version,
    0,
    1024,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'DataPipeline.GetPipelineDefinition'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'pipelineId': pipelineId,
      if (version != null) 'version': version,
    },
  );

  return GetPipelineDefinitionOutput.fromJson(jsonResponse.body);
}