createRepository method
Creates a new, empty repository.
May throw RepositoryNameExistsException. May throw RepositoryNameRequiredException. May throw InvalidRepositoryNameException. May throw InvalidRepositoryDescriptionException. May throw RepositoryLimitExceededException. May throw EncryptionIntegrityChecksFailedException. May throw EncryptionKeyAccessDeniedException. May throw EncryptionKeyDisabledException. May throw EncryptionKeyNotFoundException. May throw EncryptionKeyUnavailableException. May throw InvalidTagsMapException. May throw TooManyTagsException. May throw InvalidSystemTagUsageException. May throw TagPolicyException.
Parameter repositoryName
:
The name of the new repository to be created.
Parameter repositoryDescription
:
A comment or description about the new repository.
Parameter tags
:
One or more tag key-value pairs to use when tagging this repository.
Implementation
Future<CreateRepositoryOutput> createRepository({
required String repositoryName,
String? repositoryDescription,
Map<String, String>? tags,
}) async {
ArgumentError.checkNotNull(repositoryName, 'repositoryName');
_s.validateStringLength(
'repositoryName',
repositoryName,
1,
100,
isRequired: true,
);
_s.validateStringLength(
'repositoryDescription',
repositoryDescription,
0,
1000,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'CodeCommit_20150413.CreateRepository'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'repositoryName': repositoryName,
if (repositoryDescription != null)
'repositoryDescription': repositoryDescription,
if (tags != null) 'tags': tags,
},
);
return CreateRepositoryOutput.fromJson(jsonResponse.body);
}