batchAssociateApprovalRuleTemplateWithRepositories method
Creates an association between an approval rule template and one or more specified repositories.
May throw ApprovalRuleTemplateNameRequiredException. May throw InvalidApprovalRuleTemplateNameException. May throw ApprovalRuleTemplateDoesNotExistException. May throw RepositoryNamesRequiredException. May throw MaximumRepositoryNamesExceededException. May throw EncryptionIntegrityChecksFailedException. May throw EncryptionKeyAccessDeniedException. May throw EncryptionKeyDisabledException. May throw EncryptionKeyNotFoundException. May throw EncryptionKeyUnavailableException.
Parameter approvalRuleTemplateName
:
The name of the template you want to associate with one or more
repositories.
Parameter repositoryNames
:
The names of the repositories you want to associate with the template.
Implementation
Future<BatchAssociateApprovalRuleTemplateWithRepositoriesOutput>
batchAssociateApprovalRuleTemplateWithRepositories({
required String approvalRuleTemplateName,
required List<String> repositoryNames,
}) async {
ArgumentError.checkNotNull(
approvalRuleTemplateName, 'approvalRuleTemplateName');
_s.validateStringLength(
'approvalRuleTemplateName',
approvalRuleTemplateName,
1,
100,
isRequired: true,
);
ArgumentError.checkNotNull(repositoryNames, 'repositoryNames');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target':
'CodeCommit_20150413.BatchAssociateApprovalRuleTemplateWithRepositories'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'approvalRuleTemplateName': approvalRuleTemplateName,
'repositoryNames': repositoryNames,
},
);
return BatchAssociateApprovalRuleTemplateWithRepositoriesOutput.fromJson(
jsonResponse.body);
}