updateApprovalRuleTemplateContent method
Updates the content of an approval rule template. You can change the number of required approvals, the membership of the approval rule, and whether an approval pool is defined.
May throw ApprovalRuleTemplateContentRequiredException.
May throw ApprovalRuleTemplateDoesNotExistException.
May throw ApprovalRuleTemplateNameRequiredException.
May throw InvalidApprovalRuleTemplateContentException.
May throw InvalidApprovalRuleTemplateNameException.
May throw InvalidRuleContentSha256Exception.
Parameter approvalRuleTemplateName :
The name of the approval rule template where you want to update the
content of the rule.
Parameter newRuleContent :
The content that replaces the existing content of the rule. Content
statements must be complete. You cannot provide only the changes.
Parameter existingRuleContentSha256 :
The SHA-256 hash signature for the content of the approval rule. You can
retrieve this information by using GetPullRequest.
Implementation
Future<UpdateApprovalRuleTemplateContentOutput>
updateApprovalRuleTemplateContent({
required String approvalRuleTemplateName,
required String newRuleContent,
String? existingRuleContentSha256,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'CodeCommit_20150413.UpdateApprovalRuleTemplateContent'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'approvalRuleTemplateName': approvalRuleTemplateName,
'newRuleContent': newRuleContent,
if (existingRuleContentSha256 != null)
'existingRuleContentSha256': existingRuleContentSha256,
},
);
return UpdateApprovalRuleTemplateContentOutput.fromJson(jsonResponse.body);
}