putApprovalResult method
- required String actionName,
- required String pipelineName,
- required ApprovalResult result,
- required String stageName,
- required String token,
Provides the response to a manual approval request to AWS CodePipeline. Valid responses include Approved and Rejected.
May throw InvalidApprovalTokenException. May throw ApprovalAlreadyCompletedException. May throw PipelineNotFoundException. May throw StageNotFoundException. May throw ActionNotFoundException. May throw ValidationException.
Parameter actionName
:
The name of the action for which approval is requested.
Parameter pipelineName
:
The name of the pipeline that contains the action.
Parameter result
:
Represents information about the result of the approval request.
Parameter stageName
:
The name of the stage that contains the action.
Parameter token
:
The system-generated token used to identify a unique approval request. The
token for each open approval request can be obtained using the
GetPipelineState action. It is used to validate that the approval
request corresponding to this token is still valid.
Implementation
Future<PutApprovalResultOutput> putApprovalResult({
required String actionName,
required String pipelineName,
required ApprovalResult result,
required String stageName,
required String token,
}) async {
ArgumentError.checkNotNull(actionName, 'actionName');
_s.validateStringLength(
'actionName',
actionName,
1,
100,
isRequired: true,
);
ArgumentError.checkNotNull(pipelineName, 'pipelineName');
_s.validateStringLength(
'pipelineName',
pipelineName,
1,
100,
isRequired: true,
);
ArgumentError.checkNotNull(result, 'result');
ArgumentError.checkNotNull(stageName, 'stageName');
_s.validateStringLength(
'stageName',
stageName,
1,
100,
isRequired: true,
);
ArgumentError.checkNotNull(token, 'token');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'CodePipeline_20150709.PutApprovalResult'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'actionName': actionName,
'pipelineName': pipelineName,
'result': result,
'stageName': stageName,
'token': token,
},
);
return PutApprovalResultOutput.fromJson(jsonResponse.body);
}