putJobSuccessResult method

Future<void> putJobSuccessResult({
  1. required String jobId,
  2. String? continuationToken,
  3. CurrentRevision? currentRevision,
  4. ExecutionDetails? executionDetails,
  5. Map<String, String>? outputVariables,
})

Represents the success of a job as returned to the pipeline by a job worker. Used for custom actions only.

May throw ValidationException. May throw JobNotFoundException. May throw InvalidJobStateException. May throw OutputVariablesSizeExceededException.

Parameter jobId : The unique system-generated ID of the job that succeeded. This is the same ID returned from PollForJobs.

Parameter continuationToken : A token generated by a job worker, such as an AWS CodeDeploy deployment ID, that a successful job provides to identify a custom action in progress. Future jobs use this token to identify the running instance of the action. It can be reused to return more information about the progress of the custom action. When the action is complete, no continuation token should be supplied.

Parameter currentRevision : The ID of the current revision of the artifact successfully worked on by the job.

Parameter executionDetails : The execution details of the successful job, such as the actions taken by the job worker.

Parameter outputVariables : Key-value pairs produced as output by a job worker that can be made available to a downstream action configuration. outputVariables can be included only when there is no continuation token on the request.

Implementation

Future<void> putJobSuccessResult({
  required String jobId,
  String? continuationToken,
  CurrentRevision? currentRevision,
  ExecutionDetails? executionDetails,
  Map<String, String>? outputVariables,
}) async {
  ArgumentError.checkNotNull(jobId, 'jobId');
  _s.validateStringLength(
    'continuationToken',
    continuationToken,
    1,
    2048,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodePipeline_20150709.PutJobSuccessResult'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'jobId': jobId,
      if (continuationToken != null) 'continuationToken': continuationToken,
      if (currentRevision != null) 'currentRevision': currentRevision,
      if (executionDetails != null) 'executionDetails': executionDetails,
      if (outputVariables != null) 'outputVariables': outputVariables,
    },
  );
}